Skip to content

Commit

Permalink
Merge branch 'main' into 256-space-indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
amyjko authored Feb 19, 2024
2 parents cc033a3 + 507bd87 commit 97cf838
Show file tree
Hide file tree
Showing 85 changed files with 3,158 additions and 1,749 deletions.
15 changes: 8 additions & 7 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
---
name: Feature request
about: Suggest an idea for this project
about: Suggest a new or improved feature for this project
title: ''
labels: ['enhancement', 'needs design', 'needs triage']
assignees: ''
---

## What's the problem?

What are you trying to do? Is there a problem you're encountering or a wish you have that a new feature would address?
- What is the task, goal, or need this request would help someone accomplish?
- What is the context or scenario in which they would experience it?
- Who is the group of people who would be in this situation?
- What is it about the current design that makes the need above hard to satisfy?

## What's the design idea?

How would we address the problem with a new or changed feature? Provide as much detail about the idea as you currently have, but no need to provide an exact design specification if you don't have one.
If what you're describing above is broken functionality, including usability, accessibility, localization problems, report those as defects, as they are things to be fixed, not added.

## Who benefits?
## What's the design idea?

Is this something you think only you would benefit from? Are there others that would benefit? Are there others that might be harmed by supporting this?
What do you propose to change or add to address the problem above? Describe some functionality, a design concept, a redesign, or alternative designs that might address the problem. Provide as much detail about the idea as you currently have, but no need to provide an exact design specification if you don't have one. (That goes below).

## Design specification

Expand Down
15 changes: 15 additions & 0 deletions ARCHITECTURE.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,21 @@ The editor does many other things, including:
- Highlighting based on mouse, touch screen, and drag interactions, defined by `Highlights.ts`
- Providing descriptions for screen readers

### Conflicts and resolutions

After every edit, a project is analyzed for _conflicts_ (in other languages, you might call these errors).
Subclasses of `Node` can compute conflicts based on their context.
For example, `Evaluate` can generate many types of conflicts, such as `IncompatibleInput`, which happens when an input being provided doesn't match the function being evaluated.
We call them conflicts partly because they are inconsistencies in a program, and not necessarily a mistake someone made, but also because we anthropomorphize language constracts, and so "conflict" is a pun: its a disagreement between different characters in the Wordplay universe.

`Conflict.ts` is the base class of all conflicts, and all conflicts are required to define methods that describe conflicts, provide references to the nodes in a program that are involved in the conflict, and optionally offer a way to resolve a conflict.
Conflict resolutions are defined by the `Resolution` type, and generally need a way to describe the resolution, and a method that produces a revised project that resolves the conflict.

You can see an example of a conflict by creating a personally identifiable information conflict (`PossiblePII.ts`).
Try typing the program email: 'ajko@uw.edu'. It'll give a conflict that it seems to be personally identifiable information.
There's an option there to say "No, it's not", and then the warning goes away.
Clicking that button calls `PossiblePII`'s `getResolution` method to generate a revised project.

### Palette

The palette is a special kind of editor that offers user interfaces for transforming the `Evaluate` nodes that represent Phrases, Groups, and Stages. It constructs detailed models of the `Evaluate`, and defines many controls for modifying inputs to the `Evaluate`.
Expand Down
57 changes: 57 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,63 @@
We'll note all notable changes in this file, including bug fixes, enhancements, and all closed issues.
Dates are in `YYYY-MM-DD` format and versions are in [semantic versioning](http://semver.org/) format.

## 0.9.32 2024-02-17

## Fixed

- [#382](https://github.com/wordplaydev/wordplay/issues/382): Wait for gallery to be created before redirecting.
- Don't show preview if there are no projects in a gallery.
- Fixed text placeholder error, preventing empty gallery description from being rendered.
- Better feedback on too many login failures
- Added admin script to update user password
- Fixed MIME type on NotoEmoji preload
- More consistent list function names.
- Slightly faster list creation.
- Slightly faster number to list conversion.

## 0.9.31 2024-02-10

## Added

- [#362](https://github.com/wordplaydev/wordplay/issues/362): Added elision syntax to allow temporary removal of code from parsing (e.g., removing `2` from `1 + *2* 3`). Also included a toolbar and keyboard command for quick toggling.
- [#336](https://github.com/wordplaydev/wordplay/issues/336): Added basic syntax error resolution suggestions.

## Fixed

- English tutorial typos
- Maximum project name length in footer.
- Maximum toggle length.
- Anchor dialog close buttons when scrolling.
- Added missing Source input documentation.
- Restored duplicate name warnings.
- Incorrectly formatted inline code in tutorial.
- Fixed font on non-emoji toolbar symbol icons.
- Remove confusing automatically inserted placeholder at end of programs.
- [#374](https://github.com/wordplaydev/wordplay/issues/374): Allow deletion of selected placeholder.
- [#381](https://github.com/wordplaydev/wordplay/issues/381): Removed confusing line break insertion behavior.

## 0.9.3 2024-02-03

## Added

- [#23](https://github.com/wordplaydev/wordplay/issues/23): Source file output with `Source()`, allowing data persistence in a project.
- Added support for page up and page down to navigate to start and end of source
- Line breaks for long literals

## Fixed

- Fixed list literal types in the presence of spreads (e.g., `[:list 2 3]`)
- Fixed end command to go to end of last line.
- Fixed direction of annotation toggle error.

## 0.9.21 2024-01-28

- [#176](https://github.com/wordplaydev/wordplay/issues/176): TextFields can increment and decrement numbers.
- [#364](https://github.com/wordplaydev/wordplay/issues/364): Enabled email enumeration protection.
- [#361](https://github.com/wordplaydev/wordplay/issues/361): Fixed popup dismissal.
- [#359](https://github.com/wordplaydev/wordplay/issues/359): Fixed error in windows build command.
- [#365](https://github.com/wordplaydev/wordplay/issues/365): Enforce number of acts and scenes.

## 0.9.20 2024-01-20

## Added
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wordplay",
"version": "0.9.31",
"version": "0.9.32",
"scripts": {
"postinstall": "run-script-os",
"postinstall:default": "svelte-kit sync && cp .env.template .env",
Expand Down
10 changes: 4 additions & 6 deletions scripts/claims.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ const flags = ['admin', 'mod', 'banned'];
// If there aren't any arguments, bail.
if (process.argv.length <= 2) {
console.log('usage:');
console.log(
`node claims.cjs [email] [dev|prod] [+|-] [${flags.join('|')}]`
);
console.log(`node claims.js [email] [dev|prod] [+|-] [${flags.join('|')}]`);
process.exit();
}

Expand All @@ -28,7 +26,7 @@ if (email === undefined) {
const project = process.argv[3];
if (project !== 'dev' && project !== 'prod') {
console.log(
`Expected 'dev' or 'prod' after email, but received ${project}`
`Expected 'dev' or 'prod' after email, but received ${project}`,
);
process.exit();
}
Expand All @@ -53,7 +51,7 @@ const serviceKeyPath = `../firebase-${project}-service-key.json`;

// Log in with the secret service key generated in the Firebase service accounts console.
const serviceAccount = JSON.parse(
readFileSync(`../wordplay-${project}-service-key.json`, 'utf8')
readFileSync(`../wordplay-${project}-service-key.json`, 'utf8'),
);

if (serviceAccount === undefined) {
Expand Down Expand Up @@ -91,7 +89,7 @@ getAuth()
console.log(
`Successfully ${
operation === '+' ? 'added' : 'removed'
} '${privilege}' privilege`
} '${privilege}' privilege`,
);
});
}
Expand Down
78 changes: 78 additions & 0 deletions scripts/password.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/**
* This script enables viewing and updating a user's claims.
* so it's what we've got. Run it with `node claims.cjs`
*/
import admin from 'firebase-admin';
import { getAuth } from 'firebase-admin/auth';
import { readFileSync } from 'fs';

// If there aren't any arguments, bail.
if (process.argv.length <= 2) {
console.log('usage:');
console.log(`node updatepassword.js [email] [dev|prod] [password]`);
process.exit();
}

// Get the requested email and bail if none was provided.
const email = process.argv[2];
if (email === undefined) {
console.log('No email provided.');
process.exit();
}

// Get the project, either "dev" or "prod"
const project = process.argv[3];
if (project !== 'dev' && project !== 'prod') {
console.log(
`Expected 'dev' or 'prod' after email, but received ${project}`,
);
process.exit();
}

// Get the field
const pass = process.argv[4];
if (pass === undefined || pass.length < 8) {
console.log(`Need a password of at least 8 characters.`);
process.exit();
}

console.log('Reading service key...');

const serviceKeyPath = `../firebase-${project}-service-key.json`;

// Log in with the secret service key generated in the Firebase service accounts console.
const serviceAccount = JSON.parse(
readFileSync(`../wordplay-${project}-service-key.json`, 'utf8'),
);

if (serviceAccount === undefined) {
console.log(`Couldn't find service key at ${serviceKeyPath}`);
process.exit();
}

console.log('Connecting to Firebase with key...');

// Initialize the SDK with the service account.
admin.initializeApp({
credential: admin.credential.cert(serviceAccount),
});

// Add the publisher claim to the email address.
getAuth()
.getUserByEmail(email)
.then((user) => {
getAuth()
.updateUser(user.uid, {
password: pass,
})
.then(() => {
// See the UserRecord reference doc for the contents of userRecord.
console.log('Successfully updated password.');
})
.catch((error) => {
console.log('Error updating password.', error);
});
})
.catch((error) => {
console.log(error);
});
10 changes: 5 additions & 5 deletions src/app.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,9 @@

<link
rel="preload"
as="style"
as="font"
href="%sveltekit.assets%/fonts/NotoEmoji/NotoEmoji-400.woff2"
/>
<link
href="%sveltekit.assets%/fonts/NotoEmoji/NotoEmoji-400.woff2"
rel="stylesheet"
/>

<style>
@font-face {
Expand Down Expand Up @@ -331,6 +327,10 @@
p {
margin-block-start: 0;
margin-block-end: 1.5em;
}

p,
li {
line-height: 1.5;
}

Expand Down
2 changes: 1 addition & 1 deletion src/basis/ListBasis.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ test.each([
['[1 2 3].length()', '3'],
['[1 2 3].first()', '1'],
['[1 2 3].last()', '3'],
['[1 2 3].reverse()', '[3 2 1]'],
['[1 2 3].reversed()', '[3 2 1]'],
['[1 2 3].sansFirst()', '[2 3]'],
['[1 2 3].sansLast()', '[1 2]'],
['[1 2 3].sans(2)', '[1 3]'],
Expand Down
Loading

0 comments on commit 97cf838

Please sign in to comment.