@rohal12/spindle 0.59.31 → 0.59.33
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -18
- package/dist/pkg/format.js +1 -1
- package/dist/pkg/headless.js +717 -203
- package/package.json +1 -1
- package/src/action-registry.ts +87 -3
- package/src/automation/load-yaml.ts +10 -55
- package/src/automation/runner.ts +2 -14
- package/src/automation/types.ts +2 -8
- package/src/components/PassageDialog.tsx +47 -11
- package/src/components/dialog-close-context.ts +10 -0
- package/src/components/macros/Checkbox.tsx +2 -1
- package/src/components/macros/Cycle.tsx +2 -1
- package/src/components/macros/Dialog.tsx +14 -3
- package/src/components/macros/Listbox.tsx +2 -1
- package/src/components/macros/Radiobutton.tsx +3 -1
- package/src/components/macros/detached-body.tsx +19 -8
- package/src/components/macros/input-macro.ts +2 -1
- package/src/define-macro.ts +42 -16
- package/src/display-only.ts +30 -0
- package/src/headless.ts +81 -1
- package/src/hooks/use-action.ts +31 -9
- package/src/index.tsx +16 -4
- package/src/observe/observable-text.ts +147 -0
- package/src/observe/observe.ts +160 -0
- package/src/store.ts +1 -0
- package/src/story-api.ts +21 -1
- package/src/story-context-passage.ts +132 -0
- package/src/triggers.ts +32 -8
- package/src/utils/field-checks.ts +46 -0
- package/types/headless.d.ts +43 -2
- package/types/index.d.ts +74 -1
package/README.md
CHANGED
|
@@ -85,24 +85,25 @@ checks and compares against a base (`--base main`). Locally, CPD needs
|
|
|
85
85
|
Before adding a helper, parser or hook, look for the one that already does
|
|
86
86
|
the job and extend it; most fixes then land in one place. The shared modules:
|
|
87
87
|
|
|
88
|
-
| Job | Module
|
|
89
|
-
| -------------------------------------------------------- |
|
|
90
|
-
| Name-keyed storage, own-key reads (`hasOwn`, `ownValue`) | `src/utils/namespace.ts`
|
|
91
|
-
| Case-insensitive macro/widget names | `src/utils/macro-names.ts`
|
|
92
|
-
| Clone, equality, structural diff and merge | `src/structural.ts`
|
|
93
|
-
| Macro arguments: declared `parameters`, `ctx.args` | `src/components/macros/macro-args.ts`
|
|
94
|
-
| Quoting, splitting, string scanning | `src/components/macros/arg-utils.ts`
|
|
95
|
-
| JavaScript scanning (`findCodeEnd`, `lexJs`) | `src/js-lexer.ts`
|
|
96
|
-
| Which declaration a variable names (`Bindings`) | `src/js-bindings.ts`
|
|
97
|
-
| Sigils and scopes (`SIGIL_SCOPES`, `SCOPE_SIGILS`) | `src/markup/tokens.ts`
|
|
98
|
-
| Passage markup (`parseMarkup`, `tokenizeMarkup`) | `src/markup/parse.ts` (grammar: `src/markup/spindle.peggy`)
|
|
99
|
-
| Where code in `{…}` ends (`closeBrace`, `rawBodyEnd`) | `src/markup/code-end.ts`
|
|
100
|
-
| Which closer closes which opener (`pairMarkup`, the AST) | `src/markup/pair.ts` (`buildAst` in `src/markup/ast.ts`)
|
|
101
|
-
| Code, passage names and markup text in a passage | `src/code-check.ts` (`passagePiecesOf`)
|
|
102
|
-
| Declarations of `StoryVariables` (`parseDeclarations`) | `src/story-variables.ts` (literals: `src/static-literal.ts`)
|
|
103
|
-
| Reading story state / render contexts in components | `src/hooks/use-story-fields.ts`, `src/hooks/use-render-options.ts`
|
|
104
|
-
| Save storage operations | `src/saves/storage.ts` (`createBackend`)
|
|
105
|
-
| Listeners to notify (`createListeners`) | `src/utils/listeners.ts`
|
|
88
|
+
| Job | Module |
|
|
89
|
+
| -------------------------------------------------------- | ------------------------------------------------------------------- |
|
|
90
|
+
| Name-keyed storage, own-key reads (`hasOwn`, `ownValue`) | `src/utils/namespace.ts` |
|
|
91
|
+
| Case-insensitive macro/widget names | `src/utils/macro-names.ts` |
|
|
92
|
+
| Clone, equality, structural diff and merge | `src/structural.ts` |
|
|
93
|
+
| Macro arguments: declared `parameters`, `ctx.args` | `src/components/macros/macro-args.ts` |
|
|
94
|
+
| Quoting, splitting, string scanning | `src/components/macros/arg-utils.ts` |
|
|
95
|
+
| JavaScript scanning (`findCodeEnd`, `lexJs`) | `src/js-lexer.ts` |
|
|
96
|
+
| Which declaration a variable names (`Bindings`) | `src/js-bindings.ts` |
|
|
97
|
+
| Sigils and scopes (`SIGIL_SCOPES`, `SCOPE_SIGILS`) | `src/markup/tokens.ts` |
|
|
98
|
+
| Passage markup (`parseMarkup`, `tokenizeMarkup`) | `src/markup/parse.ts` (grammar: `src/markup/spindle.peggy`) |
|
|
99
|
+
| Where code in `{…}` ends (`closeBrace`, `rawBodyEnd`) | `src/markup/code-end.ts` |
|
|
100
|
+
| Which closer closes which opener (`pairMarkup`, the AST) | `src/markup/pair.ts` (`buildAst` in `src/markup/ast.ts`) |
|
|
101
|
+
| Code, passage names and markup text in a passage | `src/code-check.ts` (`passagePiecesOf`) |
|
|
102
|
+
| Declarations of `StoryVariables` (`parseDeclarations`) | `src/story-variables.ts` (literals: `src/static-literal.ts`) |
|
|
103
|
+
| Reading story state / render contexts in components | `src/hooks/use-story-fields.ts`, `src/hooks/use-render-options.ts` |
|
|
104
|
+
| Save storage operations | `src/saves/storage.ts` (`createBackend`) |
|
|
105
|
+
| Listeners to notify (`createListeners`) | `src/utils/listeners.ts` |
|
|
106
|
+
| Checking plain data handed in (`checkObject`, matchers) | `src/utils/field-checks.ts` (`checkActionMatcher`: action registry) |
|
|
106
107
|
|
|
107
108
|
## License
|
|
108
109
|
|