spell 0.8.8 → 0.8.9

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.
Files changed (92) hide show
  1. package/README-epics.md +60 -20
  2. package/app/package.json +1 -1
  3. package/app/spaces/@spell/guides/SpellUI/SpellUI.spellml +486 -486
  4. package/app/spaces/@spell/sites/SpellApp/SpellApp.spellml +50 -124
  5. package/dist/app/app/pages/SiteBoardView.css +5 -5
  6. package/dist/app/app/pages/SiteBoardView.js +1 -1
  7. package/dist/app/app/pages/SiteEditorPage.js +6 -3
  8. package/dist/app/app/pages/SiteEdits.js +27 -10
  9. package/dist/app/app/pages/SiteWrites.js +11 -0
  10. package/dist/app/app/runner/spellRuntime.js +1 -0
  11. package/dist/epic/cli/EpicProgram.js +15 -6
  12. package/dist/epic/cli/epicGroups.js +5 -0
  13. package/dist/epic/command/BaseBranch.js +1 -1
  14. package/dist/epic/command/PullRequest.d.ts +45 -0
  15. package/dist/epic/command/PullRequest.js +100 -0
  16. package/dist/epic/command/RepoInit.d.ts +96 -47
  17. package/dist/epic/command/RepoInit.js +222 -96
  18. package/dist/epic/command/Requests.js +2 -1
  19. package/dist/epic/command/Worktrees.d.ts +5 -3
  20. package/dist/epic/command/Worktrees.js +9 -8
  21. package/dist/epic/components/__pack/epics.entry.js +43 -43
  22. package/dist/epic/components/__pack/epics.pack.js +2 -2
  23. package/dist/epic/config/CodeHost.d.ts +96 -0
  24. package/dist/epic/config/CodeHost.js +89 -0
  25. package/dist/epic/config/EpicConfig.d.ts +9 -2
  26. package/dist/epic/config/EpicConfig.js +16 -0
  27. package/dist/epic/config/EpicRepo.js +1 -1
  28. package/dist/epic/config/GitHub.d.ts +34 -2
  29. package/dist/epic/config/GitHub.js +36 -7
  30. package/dist/epic/config/GitLab.d.ts +138 -0
  31. package/dist/epic/config/GitLab.js +297 -0
  32. package/dist/epic/tool/PlanCommits.d.ts +7 -4
  33. package/dist/epic/tool/PlanCommits.js +7 -5
  34. package/dist/epic/tool/PlanDocCommands.js +3 -4
  35. package/dist/epic/tool/PlanDocFiles.d.ts +3 -1
  36. package/dist/epic/tool/PlanDocFiles.js +10 -3
  37. package/dist/parser/core/classes/View.d.ts +20 -0
  38. package/dist/parser/core/classes/View.js +91 -17
  39. package/dist/parser/core/core.declarations.json5 +18 -0
  40. package/dist/parser/core/core.scopes.js +5 -0
  41. package/dist/parser/core/sites.d.ts +10 -0
  42. package/dist/parser/core/sites.js +12 -0
  43. package/dist/parser/parser/tokenizer/Tokenizer.d.ts +9 -1
  44. package/dist/parser/parser/tokenizer/Tokenizer.js +43 -5
  45. package/dist/parser/parser/tokenizer/Tokens.d.ts +4 -0
  46. package/dist/parser/parser/tokenizer/Tokens.js +4 -0
  47. package/dist/parser/parser/tokenizer/tokenizer.types.d.ts +5 -0
  48. package/dist/parser/parser/tokenizer/tokenizer.types.js +2 -0
  49. package/dist/parser/py/core/spell_core/apps.py +2 -0
  50. package/dist/parser/spell/PARSING.md +21 -0
  51. package/dist/parser/spell/SpellParser.d.ts +2 -0
  52. package/dist/parser/spell/SpellParser.js +58 -3
  53. package/dist/parser/spell/SpellxTokenizer.js +2 -1
  54. package/dist/parser/spell/SpellxTwin.d.ts +4 -1
  55. package/dist/parser/spell/SpellxTwin.js +10 -3
  56. package/dist/parser/spell/builtinTypes.js +24 -1
  57. package/dist/parser/spell/ingest/PlaceIngest.js +3 -1
  58. package/dist/parser/spell/languages/Language.d.ts +11 -2
  59. package/dist/parser/spell/languages/en/words.js +3 -2
  60. package/dist/parser/spell/languages/es/words.js +7 -4
  61. package/dist/parser/spell/rules/Statement.js +1 -1
  62. package/dist/parser/spell/rules/classes/DrawSlot.js +6 -1
  63. package/dist/parser/spell/rules/sites/SitePage.d.ts +3 -3
  64. package/dist/parser/spell/rules/sites/SitePage.js +2 -2
  65. package/dist/parser/spell/rules/sites/sites.en.js +1 -1
  66. package/dist/parser/spell/rules/sites/sites.es.js +1 -1
  67. package/dist/parser/spell/rules/sites/sites.shared.d.ts +2 -2
  68. package/dist/parser/spell/spell.types.d.ts +7 -0
  69. package/dist/parser/spell/spellSyntax.es.json +6 -6
  70. package/dist/parser/spell/spellSyntax.json +6 -6
  71. package/dist/parser/spellx/SpellxView.js +2 -1
  72. package/dist/ui/components/ui-parts/UIHeader.d.ts +12 -2
  73. package/dist/ui/components/ui-parts/UIHeader.en.d.ts +5 -2
  74. package/dist/ui/components/ui-parts/UIHeader.en.js +6 -3
  75. package/dist/ui/components/ui-parts/UIHeader.js +45 -5
  76. package/dist/ui/components/ui-parts/UIParts.css +18 -0
  77. package/dist/ui/components/ui-parts/UIParts.css.inline.js +1 -1
  78. package/dist/ui/jsx.d.ts +4 -4
  79. package/dist/ui/vocabulary/defaults.generated.js +1 -1
  80. package/dist/util/spell/constants.js +1 -1
  81. package/epic/.claude-plugin/plugin.json +1 -1
  82. package/epic/.codex-plugin/plugin.json +1 -1
  83. package/epic/package.json +1 -1
  84. package/epic/skills/epic/SKILL.md +2 -2
  85. package/epic/skills/epic/guide.md +2 -3
  86. package/epic/skills/isolate/SKILL.md +25 -27
  87. package/epic/src/AGENTS.md +5 -0
  88. package/epic/vscode/package.json +1 -1
  89. package/epic/vscode/spell-epic.vsix +0 -0
  90. package/package.json +1 -1
  91. package/parser/package.json +1 -1
  92. package/ui/package.json +1 -1
@@ -10,6 +10,18 @@ var siteMethods = defineCoreModule({
10
10
  * - The editor's Run sets it for each run: `/run/<project>/films/4` shows `/films/4`, and back and forward work.
11
11
  */
12
12
  siteHost: void 0,
13
+ /**
14
+ * The folder of the program running, as an address: `/spaces/@spell/sites/SpellApp`.
15
+ * - Set by whatever runs it; none: a file's name is left as it is, relative to the page.
16
+ */
17
+ projectFolder: void 0,
18
+ /**
19
+ * The address of `file`, a file of the running project: `snapshots/terms.jpg` => `/spaces/.../snapshots/terms.jpg`.
20
+ * - An address of its own (`/x.jpg`, `https://...`, `data:...`) is left as it is.
21
+ */
22
+ addressOfFile(file) {
23
+ return !core.projectFolder || /^(\/|[a-z][a-z0-9+.-]*:)/i.test(file) ? file : `${core.projectFolder}/${file}`;
24
+ },
13
25
  /**
14
26
  * Show the site's page `name`, its parameter filled with `thing`, or open its dialog or sidebar of that name:
15
27
  * what `go to the film page for this film` and `show the settings dialog` compile to.
@@ -23,9 +23,10 @@ export declare class Tokenizer {
23
23
  */
24
24
  standAloneTags: string[];
25
25
  /**
26
- * JSX tags that take a bare quoted string as an attribute, by the attribute it is:
26
+ * JSX tags that take a bare quoted string, by what it becomes:
27
27
  * `<example "one counter">` is `name="one counter"` with `{ example: "name" }`.
28
28
  * - e.g. spell's `{ example: "name", "tree-node": "label" }`.
29
+ * - `P.QUOTED_CONTENTS`: the word is the tag's contents, `<header "Hardware"/>` ~== `<header>Hardware</header>`.
29
30
  * - None by default: anywhere else a bare string in a tag is no attribute.
30
31
  */
31
32
  quotedNameTags: Record<string, string>;
@@ -227,6 +228,13 @@ export declare class Tokenizer {
227
228
  * `quotedNameTags` says -- only for one of them.
228
229
  */
229
230
  matchJSXQuotedName(tagName: string, text: string, start: number, end: number): P.JSXAttributeToken | undefined;
231
+ /**
232
+ * A tag's quoted word at `start`, `"Hardware"` in `<header "Hardware">`, as the tokens its contents would be
233
+ * between its tags -- only for a tag `quotedNameTags` says takes one (`P.QUOTED_CONTENTS`).
234
+ * - `{its name}` in it is a hole, as it is between the tags; anything else in the quotes is text, a `<` too.
235
+ * - `next`: where the tag's attributes go on.
236
+ */
237
+ private matchJSXQuotedContents;
230
238
  /**
231
239
  * A CHAIN tag's head at `start` of `text`, `<otherwise if its done is yes>`, as a `JSXElementToken` with its `chain`
232
240
  * and `phrase` -- `undefined` if no word of `chainTags` starts a tag there.
@@ -27,9 +27,10 @@ var Tokenizer = class _Tokenizer {
27
27
  */
28
28
  standAloneTags = [];
29
29
  /**
30
- * JSX tags that take a bare quoted string as an attribute, by the attribute it is:
30
+ * JSX tags that take a bare quoted string, by what it becomes:
31
31
  * `<example "one counter">` is `name="one counter"` with `{ example: "name" }`.
32
32
  * - e.g. spell's `{ example: "name", "tree-node": "label" }`.
33
+ * - `P.QUOTED_CONTENTS`: the word is the tag's contents, `<header "Hardware"/>` ~== `<header>Hardware</header>`.
33
34
  * - None by default: anywhere else a bare string in a tag is no attribute.
34
35
  */
35
36
  quotedNameTags = {};
@@ -435,9 +436,14 @@ var Tokenizer = class _Tokenizer {
435
436
  jsxElement.record.children = children;
436
437
  jsxElement.record.raw = text.slice(start, children[children.length - 1].next);
437
438
  }
438
- } else if (!jsxElement.record.isUnaryTag) {
439
- const children = this.rawTextTags.includes(jsxElement.tagName) ? this.matchRawJSXChildren(jsxElement.tagName, text, jsxElement.next, end) : this.matchJSXChildren(jsxElement.tagName, text, jsxElement.next, end);
440
- if (children && children.length) {
439
+ } else if (jsxElement.record.isUnaryTag) {
440
+ if (jsxElement.record.quotedContents?.length) {
441
+ jsxElement.record.children = jsxElement.record.quotedContents;
442
+ }
443
+ } else {
444
+ const matched = this.rawTextTags.includes(jsxElement.tagName) ? this.matchRawJSXChildren(jsxElement.tagName, text, jsxElement.next, end) : this.matchJSXChildren(jsxElement.tagName, text, jsxElement.next, end);
445
+ const children = [...jsxElement.record.quotedContents ?? [], ...matched ?? []];
446
+ if (children.length) {
441
447
  jsxElement.record.children = children;
442
448
  jsxElement.record.raw = text.slice(start, children[children.length - 1].next);
443
449
  }
@@ -483,6 +489,11 @@ var Tokenizer = class _Tokenizer {
483
489
  if (endBit !== ">" && endBit !== "/>") {
484
490
  const named = this.matchJSXQuotedName(tagName, text, nextStart, end);
485
491
  if (named) nextStart = named.next;
492
+ const quotedContents = named ? void 0 : this.matchJSXQuotedContents(tagName, text, nextStart, end);
493
+ if (quotedContents) {
494
+ nextStart = quotedContents.next;
495
+ jsxElement.record.quotedContents = quotedContents.contents;
496
+ }
486
497
  const attributes = named ? [named] : [];
487
498
  let endBitMatch;
488
499
  while (true) {
@@ -534,12 +545,39 @@ var Tokenizer = class _Tokenizer {
534
545
  */
535
546
  matchJSXQuotedName(tagName, text, start, end) {
536
547
  const name = this.quotedNameTags[tagName];
537
- if (!name) return void 0;
548
+ if (!name || name === P.QUOTED_CONTENTS) return void 0;
538
549
  const value = this.matchText(text, start, end);
539
550
  if (!value) return void 0;
540
551
  const next = this.eatWhitespace(text, value.next, end);
541
552
  return new P.JSXAttributeToken({ name, start, value, raw: text.slice(start, next) });
542
553
  }
554
+ /**
555
+ * A tag's quoted word at `start`, `"Hardware"` in `<header "Hardware">`, as the tokens its contents would be
556
+ * between its tags -- only for a tag `quotedNameTags` says takes one (`P.QUOTED_CONTENTS`).
557
+ * - `{its name}` in it is a hole, as it is between the tags; anything else in the quotes is text, a `<` too.
558
+ * - `next`: where the tag's attributes go on.
559
+ */
560
+ matchJSXQuotedContents(tagName, text, start, end) {
561
+ if (this.quotedNameTags[tagName] !== P.QUOTED_CONTENTS) return void 0;
562
+ const value = this.matchText(text, start, end);
563
+ if (!value) return void 0;
564
+ const wordStart = text.indexOf('"', start) + 1;
565
+ const wordEnd = wordStart + value.innerText.length;
566
+ const contents = [];
567
+ for (let at = wordStart; at < wordEnd; ) {
568
+ const brace = text.indexOf("{", at);
569
+ const textEnd = brace < 0 || brace >= wordEnd ? wordEnd : brace;
570
+ const hole = textEnd < wordEnd ? this.matchJSXExpression(text, textEnd, wordEnd) : void 0;
571
+ const stop = hole || textEnd === wordEnd ? textEnd : wordEnd;
572
+ if (stop > at) {
573
+ const raw = text.slice(at, stop);
574
+ contents.push(new P.JSXTextToken({ value: raw.replace(/\\(["\\])/g, "$1"), raw, start: at }));
575
+ }
576
+ if (hole) contents.push(hole);
577
+ at = hole ? hole.next : stop;
578
+ }
579
+ return { contents, next: this.eatWhitespace(text, value.next, end) };
580
+ }
543
581
  /**
544
582
  * A CHAIN tag's head at `start` of `text`, `<otherwise if its done is yes>`, as a `JSXElementToken` with its `chain`
545
583
  * and `phrase` -- `undefined` if no word of `chainTags` starts a tag there.
@@ -136,6 +136,8 @@ export declare class JSXElementToken extends JSXToken<never, JSXElementTokenProp
136
136
  get children(): JSXElementToken[] | undefined;
137
137
  /** Does this represent a unary tag? */
138
138
  get isUnaryTag(): boolean | undefined;
139
+ /** What its quoted word became, the first of its `children`: `Hardware` in `<header "Hardware">`. */
140
+ get quotedContents(): Token<any, P.TokenProps<any>>[] | undefined;
139
141
  /** What it couldn't read among its attributes, `Ždge="1,048"` -- `undefined` when it read them all. */
140
142
  get unreadable(): string | undefined;
141
143
  /** A chain branch's kind, `<if ...>`, `<otherwise>` ...: see `Tokenizer.chainTags`. `undefined` for an element. */
@@ -151,6 +153,8 @@ export type JSXElementTokenProps = Prettify<P.TokenProps<never>> & {
151
153
  tagName: string;
152
154
  /** Does this represent a unary tag? */
153
155
  isUnaryTag?: boolean;
156
+ /** What its quoted word became -- see `JSXElementToken.quotedContents`. */
157
+ quotedContents?: P.Token[];
154
158
  /** What it couldn't read among its attributes -- see `JSXElementToken.unreadable`. */
155
159
  unreadable?: string;
156
160
  /** A chain branch's kind -- see `JSXElementToken.chain`. */
@@ -190,6 +190,10 @@ var JSXElementToken = class extends JSXToken {
190
190
  get isUnaryTag() {
191
191
  return this.record.isUnaryTag;
192
192
  }
193
+ /** What its quoted word became, the first of its `children`: `Hardware` in `<header "Hardware">`. */
194
+ get quotedContents() {
195
+ return this.record.quotedContents;
196
+ }
193
197
  /** What it couldn't read among its attributes, `Ždge="1,048"` -- `undefined` when it read them all. */
194
198
  get unreadable() {
195
199
  return this.record.unreadable;
@@ -27,6 +27,11 @@ export type TokenMatcher<T = P.Token> = (text: string, start?: number, end?: num
27
27
  * Policy for automatically removing whitespace from the token stream.
28
28
  * - REFACTOR: idiomatic TS enum string pattern?
29
29
  */
30
+ /**
31
+ * In `Tokenizer.quotedNameTags`: this tag's quoted word is its contents, not an attribute.
32
+ * - `<header "Hardware"/>` ~== `<header>Hardware</header>`.
33
+ */
34
+ export declare const QUOTED_CONTENTS = "#contents";
30
35
  export declare const WhitespacePolicy: {
31
36
  readonly ALL: "ALL";
32
37
  readonly NONE: "NONE";
@@ -2,6 +2,7 @@ var __defProp = Object.defineProperty;
2
2
  var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
3
3
 
4
4
  // src/parser/tokenizer/tokenizer.types.ts
5
+ var QUOTED_CONTENTS = "#contents";
5
6
  var WhitespacePolicy = {
6
7
  ALL: "ALL",
7
8
  // Leave ALL whitespace
@@ -41,6 +42,7 @@ __name(offsetForPosition, "offsetForPosition");
41
42
  export {
42
43
  BACKSLASH,
43
44
  DOUBLE_QUOTE,
45
+ QUOTED_CONTENTS,
44
46
  SINGLE_QUOTE,
45
47
  WhitespacePolicy,
46
48
  getLineStarts,
@@ -29,6 +29,8 @@ class View(Thing):
29
29
  - `core.draw_thing()` draws it as that element, its own `draw()` inside; with no tag, as any thing draws.
30
30
  """
31
31
 
32
+ # a picture of it, a file of its project: drawn while it has no drawing of its own (`to draw it`, in the page)
33
+ thumbnail = prop()
32
34
  # our element's tag, e.g. `solitaire-card`: the compiled class names it -- see `core.element_tag_of()`
33
35
  element_tag: str | None = None
34
36
  # may a page let people drag our things? `- it is draggable` says yes -- the JavaScript core's `draggable`;
@@ -1370,6 +1370,27 @@ each tag line reads as its code-spell twin line, so it compiles to exactly what
1370
1370
  An attribute word the tag takes wins: `<view locked>` is unnamed and locked.
1371
1371
  - A tag's head may be named by a quoted name after its word in markup too, `<example "one counter">`:
1372
1372
  the parser's tokenizer reads it as `name="..."` (`quotedNameTags`); `<tree-node "If">` as `label="If"`.
1373
+ - A TAG'S QUOTED WORD (epic `language` P38): on the tags below, it's the tag's contents, or what names it:
1374
+ `<header "Hardware" size="large"/>` draws exactly what `<header size="large">Hardware</header>` draws.
1375
+ - As contents (`P.QUOTED_CONTENTS`), the tokenizer makes it the tag's first children:
1376
+ `{its name}` in it is a hole, other contents follow it, and it's a child even on a tag closed with `/>`.
1377
+ - Each language's spellings are listed: `<encabezado "...">`, `<es-encabezado "...">`.
1378
+ A word two languages spell alike but read differently is the language's own (`Language.quotedNameTags`).
1379
+
1380
+ | Tag | The quoted word is |
1381
+ | --- | --- |
1382
+ | `header`, `button`, `item`, `label`, `title`, `link`, `breadcrumb`, `checkbox`, `radio` | its contents |
1383
+ | `tab`, `panel` | its `label` |
1384
+ | `example` | its `name` |
1385
+ | `tree-node` | its `label` |
1386
+ | `cell` | its column (`data-column`) |
1387
+
1388
+ | Left out | Why |
1389
+ | --- | --- |
1390
+ | `text`, `description` | often long, or text mixed with values |
1391
+ | `td`, `th` | the web's own table tags |
1392
+ | `segment`, `column`, `content`, `stack` | they hold layouts; their short text is mostly in demos |
1393
+ | `author`, `date` | common only in Spell UI's feed and comment demos |
1373
1394
  - A COMMENT, `<!-- ... -->` (Owen, 2026-10-26), starting a line anywhere in the file: a `SP.SpellxCommentToken` per
1374
1395
  line, each a `CommentToken` as its `//` twin line is (`commentSymbol` `//`, its text without the marks).
1375
1396
  - One over several lines keeps reading lines as the comment to its `-->` (`openComment`), and `breakIntoLines()`
@@ -28,6 +28,8 @@ export declare class SpellParser extends P.Parser {
28
28
  get tokenizer(): P.Tokenizer;
29
29
  /** Spell's own tokenizer, for code spell -- and inside a spellx file's tags (`SP.SpellxTokenizer.spell`). */
30
30
  get spellTokenizer(): P.Tokenizer;
31
+ /** What our tokenizers are made with: spell's, and what this parser's language reads its own way. */
32
+ private get tokenizerProps();
31
33
  /**
32
34
  * Which FORM of spell we read: code spell (`Card.spell`), or spellx, its tag-shaped form (`Card.spellml`).
33
35
  * - Only our tokenizer differs: a spellx file's tags are tokens of their own (`SP.SpellxTokenizer`), and each tag
@@ -19,6 +19,46 @@ var CHAIN_TAGS = {
19
19
  sino: "otherwise",
20
20
  "de lo contrario": "otherwise"
21
21
  };
22
+ var QUOTED_CONTENTS_TAGS = [
23
+ "header",
24
+ "ui-header",
25
+ "encabezado",
26
+ "es-encabezado",
27
+ "button",
28
+ "ui-button",
29
+ "boton",
30
+ "botón",
31
+ "es-boton",
32
+ "item",
33
+ "ui-item",
34
+ "elemento",
35
+ "es-elemento",
36
+ "label",
37
+ "ui-label",
38
+ "etiqueta",
39
+ "es-etiqueta",
40
+ "title",
41
+ "ui-title",
42
+ "titulo",
43
+ "título",
44
+ "es-titulo",
45
+ "link",
46
+ "ui-link",
47
+ "enlace",
48
+ "es-enlace",
49
+ "breadcrumb",
50
+ "ui-breadcrumb",
51
+ "ruta-seccion",
52
+ "ruta-sección",
53
+ "es-ruta-seccion",
54
+ "checkbox",
55
+ "ui-checkbox",
56
+ "casilla",
57
+ "es-casilla",
58
+ "radio",
59
+ "ui-radio",
60
+ "es-radio"
61
+ ];
22
62
  var SPELL_TOKENIZER_PROPS = {
23
63
  // Only support double-quotes as quote symbols (so we can do contractions with single quotes)
24
64
  // TODO: backtick as alternative quote, for embedding double quotes?
@@ -45,7 +85,16 @@ var SPELL_TOKENIZER_PROPS = {
45
85
  "ui-tree-node": "label",
46
86
  "nodo-arbol": "etiqueta",
47
87
  "nodo-árbol": "etiqueta",
48
- "es-nodo-arbol": "etiqueta"
88
+ "es-nodo-arbol": "etiqueta",
89
+ // what names a tab or a panel (epic `language` P38); Spanish's `panel`: `Language.quotedNameTags`
90
+ tab: "label",
91
+ "ui-tab": "label",
92
+ solapa: "etiqueta",
93
+ "es-solapa": "etiqueta",
94
+ panel: "label",
95
+ "ui-panel": "label",
96
+ "es-panel": "etiqueta",
97
+ ...Object.fromEntries(QUOTED_CONTENTS_TAGS.map((tag) => [tag, P.QUOTED_CONTENTS]))
49
98
  },
50
99
  // an if-chain inside markup, `<text><if it is done>✓</></text>` (epic `elemental-spell`, Owen 2026-10-25):
51
100
  // each branch's elements are hidden while it isn't the one (`SpellJSX`); every language's words, as its
@@ -74,7 +123,7 @@ var SpellParser = class _SpellParser extends P.Parser {
74
123
  return this.derived(
75
124
  "spellxTokenizer",
76
125
  () => new SP.SpellxTokenizer({
77
- ...SPELL_TOKENIZER_PROPS,
126
+ ...this.tokenizerProps,
78
127
  language: this.language ?? SP.Language.default,
79
128
  // a drawing's markup: `</>` closes any element there (Q40, P7)
80
129
  emptyEndTagCloses: true,
@@ -86,7 +135,13 @@ var SpellParser = class _SpellParser extends P.Parser {
86
135
  }
87
136
  /** Spell's own tokenizer, for code spell -- and inside a spellx file's tags (`SP.SpellxTokenizer.spell`). */
88
137
  get spellTokenizer() {
89
- return this.derived("tokenizer", () => new P.Tokenizer(SPELL_TOKENIZER_PROPS));
138
+ return this.derived("tokenizer", () => new P.Tokenizer(this.tokenizerProps));
139
+ }
140
+ /** What our tokenizers are made with: spell's, and what this parser's language reads its own way. */
141
+ get tokenizerProps() {
142
+ const own = this.language?.words.quotedNameTags;
143
+ if (!own) return SPELL_TOKENIZER_PROPS;
144
+ return { ...SPELL_TOKENIZER_PROPS, quotedNameTags: { ...SPELL_TOKENIZER_PROPS.quotedNameTags, ...own } };
90
145
  }
91
146
  addRule(rule, namesOrDefinition) {
92
147
  const definition = typeof namesOrDefinition === "object" && !Array.isArray(namesOrDefinition) ? namesOrDefinition : void 0;
@@ -398,7 +398,8 @@ var SpellxTokenizer = class extends P.Tokenizer {
398
398
  selfClosing: head.selfClosing
399
399
  };
400
400
  const hasDraw = tag.kind === "page" ? this.hasDrawOfItsOwn(text, head.end, end, indent) : void 0;
401
- if (!tag.selfClosing && SP.isPageDrawingItsBody(tag, hasDraw)) {
401
+ const hasThumbnail = tag.attributes.some((attribute) => attribute.name === "thumbnail");
402
+ if ((!tag.selfClosing || hasThumbnail) && SP.isPageDrawingItsBody(tag, hasDraw)) {
402
403
  tag.drawsBody = true;
403
404
  word = { ...word, drawsBody: true };
404
405
  }
@@ -65,8 +65,11 @@ export declare class SpellxTwin {
65
65
  * - Its `menu-bar=`, a line ending its body: `- its menu bar is "GameMenu"` (P10).
66
66
  * - Its bare `draggable`, `droppable`, `selectable`: `- it is draggable` ... lines too, the outline form's flags.
67
67
  * - A page's `locked`: `- its lock is "locked"` (epic `notebook` P1).
68
+ * - A page's or view's `thumbnail=`: `- its thumbnail is "..."` (epic `mockup` P16).
68
69
  */
69
70
  private template;
71
+ /** A page's or view's `thumbnail=`, as the line that says it: none on any other tag, or without one. */
72
+ private thumbnailLines;
70
73
  /** Is the tag `locked`, `<spell-page "x" locked>`? */
71
74
  private get isLocked();
72
75
  /**
@@ -80,7 +83,7 @@ export declare class SpellxTwin {
80
83
  * - Its sections draw as the docs pages' do, sticky and foldable (epic `notebook` P3, J1):
81
84
  * - each `##` heading and what follows it, a `<section>` the twin makes: see `markdownLines()`, `gatherSections()`
82
85
  * - each `<section label="...">` written at its top level, with the same look: see `withSectionLook()`
83
- * - `locked`: a line, `- its lock is "locked"`.
86
+ * - `locked`: a line, `- its lock is "locked"`; `thumbnail=`, `- its thumbnail is "..."`.
84
87
  * - Its own templates aren't in its block: the tokenizer lifted them out, to before it (`liftPageTemplates()`).
85
88
  */
86
89
  private drawnPage;
@@ -141,6 +141,7 @@ var SpellxTwin = class _SpellxTwin {
141
141
  * - Its `menu-bar=`, a line ending its body: `- its menu bar is "GameMenu"` (P10).
142
142
  * - Its bare `draggable`, `droppable`, `selectable`: `- it is draggable` ... lines too, the outline form's flags.
143
143
  * - A page's `locked`: `- its lock is "locked"` (epic `notebook` P1).
144
+ * - A page's or view's `thumbnail=`: `- its thumbnail is "..."` (epic `mockup` P16).
144
145
  */
145
146
  template() {
146
147
  const regrouped = this.block && (_SpellxTwin.withGroupsOpened(this.block) ?? _SpellxTwin.withStoriesAsBlocks(this.block));
@@ -153,7 +154,12 @@ var SpellxTwin = class _SpellxTwin {
153
154
  const menuBar = this.attribute("menu-bar") ? [[this.bullet(), ...this.expand(this.words.menuBar)]] : [];
154
155
  const flags = Object.entries(this.words.viewFlags).filter(([name]) => this.tag.attributes.some((attribute) => attribute.name === name)).map(([, line]) => [this.bullet(), ...this.expand(line)]);
155
156
  const locked = kind === "page" && this.isLocked ? [[this.bullet(), ...this.expand(this.words.pageLocked)]] : [];
156
- return this.lineAndBlock(this.expand(shape), [], [...menuBar, ...flags, ...locked]);
157
+ return this.lineAndBlock(this.expand(shape), [], [...menuBar, ...flags, ...locked, ...this.thumbnailLines()]);
158
+ }
159
+ /** A page's or view's `thumbnail=`, as the line that says it: none on any other tag, or without one. */
160
+ thumbnailLines() {
161
+ const isDrawable = this.tag.kind === "page" || this.tag.kind === "view";
162
+ return isDrawable && this.attribute("thumbnail") ? [[this.bullet(), ...this.expand(this.words.templateThumbnail)]] : [];
157
163
  }
158
164
  /** Is the tag `locked`, `<spell-page "x" locked>`? */
159
165
  get isLocked() {
@@ -170,7 +176,7 @@ var SpellxTwin = class _SpellxTwin {
170
176
  * - Its sections draw as the docs pages' do, sticky and foldable (epic `notebook` P3, J1):
171
177
  * - each `##` heading and what follows it, a `<section>` the twin makes: see `markdownLines()`, `gatherSections()`
172
178
  * - each `<section label="...">` written at its top level, with the same look: see `withSectionLook()`
173
- * - `locked`: a line, `- its lock is "locked"`.
179
+ * - `locked`: a line, `- its lock is "locked"`; `thumbnail=`, `- its thumbnail is "..."`.
174
180
  * - Its own templates aren't in its block: the tokenizer lifted them out, to before it (`liftPageTemplates()`).
175
181
  */
176
182
  drawnPage() {
@@ -216,6 +222,7 @@ var SpellxTwin = class _SpellxTwin {
216
222
  const lineOf = /* @__PURE__ */ __name((tokens) => new P.LineToken({ start: this.head.start, line: this.head.line, ch: this.head.ch, indent, tokens }), "lineOf");
217
223
  const items = [...members];
218
224
  if (this.isLocked) items.push(lineOf([this.bullet(), ...this.expand(this.words.pageLocked)]));
225
+ items.push(...this.thumbnailLines().map(lineOf));
219
226
  if (drawing.length) {
220
227
  items.push(lineOf([this.bullet(), ...this.expand(this.words.draw)]));
221
228
  _SpellxTwin.joinMarkup(drawing);
@@ -564,7 +571,7 @@ var SpellxTwin = class _SpellxTwin {
564
571
  this.attribute("tags") ? words.sitePageTags : "",
565
572
  // the state is a word of the line, not a text: `state="old"` is `, old`
566
573
  this.attribute("state") ? words.sitePageState.replace("{state}", this.attribute("state").text) : "",
567
- this.attribute("picture") ? words.sitePagePicture : "",
574
+ this.attribute("thumbnail") ? words.sitePageThumbnail : "",
568
575
  this.siteCardWords()
569
576
  ].join(" ")
570
577
  )
@@ -375,7 +375,24 @@ var BUILT_IN_TYPE_TABLE = [
375
375
  "```"
376
376
  ),
377
377
  rules: ["create_type", "draw_it"],
378
- members: []
378
+ slots: ["thumbnail"],
379
+ members: [
380
+ {
381
+ words: "thumbnail",
382
+ kind: "property",
383
+ datatype: "text",
384
+ stored: true,
385
+ declarable: true,
386
+ anyDatatype: true,
387
+ docstring: md(
388
+ "A picture of it, a file of its project: `snapshots/terms.jpg`.",
389
+ "- Drawn while it has no drawing of its own: writing one replaces it.",
390
+ "- A drawing can place it too: `draw its thumbnail`.",
391
+ "- A site's card shows it, unless the site's line names its own.",
392
+ '- Say it on its tag, `<spell-page "terms" thumbnail="snapshots/terms.jpg"/>`, or in its body, `- its thumbnail is "..."`.'
393
+ )
394
+ }
395
+ ]
379
396
  },
380
397
  {
381
398
  name: "page",
@@ -696,6 +713,12 @@ function loadBuiltInTypes(scope, words = SP.Language.default.words, { keepExisti
696
713
  if (!keepExisting || !type.variables.get(props.name, "LOCAL_ONLY")) type.variables.add(props);
697
714
  }, "addMember");
698
715
  if (entry.itemType) type.itemType = entry.itemType;
716
+ for (const slot of entry.slots ?? []) {
717
+ const said = (words.builtInMembers?.[slot] ?? []).map(builtInMemberName);
718
+ type.slots = [.../* @__PURE__ */ new Set([...type.slots ?? [], slot, ...said])];
719
+ if (said.length)
720
+ type.slotOutputs = { ...type.slotOutputs, ...Object.fromEntries(said.map((name) => [name, slot])) };
721
+ }
699
722
  for (const member of entry.members) {
700
723
  const local = words.builtInMembers?.[member.words];
701
724
  if (member.stored) {
@@ -723,7 +723,9 @@ function whatSpellCantSay({ about, collections, canDo }) {
723
723
  "What it can filter or sort: it wasn't tried, so `where` and `sorted by` load its rows and work here, up to the usual ceiling. If it can, add `- it filters by cuisine` or `- it sorts by title`."
724
724
  );
725
725
  if (/read only/.test(canDo.write))
726
- said.add("That it's read only: it isn't said for you, so a program's write compiles, and fails when it runs. If it is, add `- it is read only`.");
726
+ said.add(
727
+ "That it's read only: it isn't said for you, so a program's write compiles, and fails when it runs. If it is, add `- it is read only`."
728
+ );
727
729
  }
728
730
  return [...said];
729
731
  }
@@ -264,6 +264,11 @@ export type LanguageWords = {
264
264
  * - Its tokenizer reads a quoted name after it (`P.Tokenizer.quotedNameTags`).
265
265
  */
266
266
  exampleTag: string;
267
+ /**
268
+ * What a quoted word after a tag becomes, for a tag two languages spell alike (`P.Tokenizer.quotedNameTags`):
269
+ * Spanish's `<panel "Ajustes">` is `etiqueta="Ajustes"`, English's `<panel "Settings">` `label="Settings"`.
270
+ */
271
+ quotedNameTags?: Record<string, string>;
267
272
  /**
268
273
  * An app's widget defaults, a block of sample tags (epic `language` P29): `<ui-defaults>`, in every language --
269
274
  * see `ui_defaults`.
@@ -509,6 +514,10 @@ export type SpellxTwinWords = {
509
514
  * - Its value quoted: a built-in member written by hand has no list of values for a bare word to name.
510
515
  */
511
516
  pageLocked: string;
517
+ /**
518
+ * A page's or view's own `thumbnail=`: a line in its body, `its thumbnail is {quoted thumbnail}` (epic `mockup` P16).
519
+ */
520
+ templateThumbnail: string;
512
521
  /**
513
522
  * A section of a page that draws its body, as its drawing writes it (epic `notebook` P3, J1):
514
523
  * Spell UI's `<section>` in the language's words, sticky and foldable as the docs pages' sections are.
@@ -531,8 +540,8 @@ export type SpellxTwinWords = {
531
540
  sitePageTags: string;
532
541
  /** What a page's `state=` adds to its line. */
533
542
  sitePageState: string;
534
- /** What a page's `picture=` adds to its line. */
535
- sitePagePicture: string;
543
+ /** What a page's `thumbnail=` adds to its line. */
544
+ sitePageThumbnail: string;
536
545
  /** What a part's `row=` and `column=` add to its line: its place in its section of the site editor's board. */
537
546
  siteCardPlace: string;
538
547
  /** What a part's `color=` adds to its line. */
@@ -240,7 +240,7 @@ var englishWords = {
240
240
  state: "state",
241
241
  tab: "tab",
242
242
  tags: "tags",
243
- picture: "picture",
243
+ thumbnail: "thumbnail",
244
244
  row: "row",
245
245
  column: "column",
246
246
  color: "color"
@@ -296,6 +296,7 @@ var englishWords = {
296
296
  menuBar: "its menu bar is {quoted menu-bar}",
297
297
  group: "group {name}",
298
298
  pageLocked: 'its lock is "locked"',
299
+ templateThumbnail: "its thumbnail is {quoted thumbnail}",
299
300
  pageSection: {
300
301
  tag: "section",
301
302
  label: "label",
@@ -308,7 +309,7 @@ var englishWords = {
308
309
  sitePageTab: ", tab {quoted tab}",
309
310
  sitePageTags: ", tagged {quoted tags}",
310
311
  sitePageState: ", {state}",
311
- sitePagePicture: ", pictured in {quoted picture}",
312
+ sitePageThumbnail: ", thumbnail {quoted thumbnail}",
312
313
  siteCardPlace: ", in row {row} column {column}",
313
314
  siteCardColor: ", colored {color}",
314
315
  siteOverlay: "it has {a words} {words}",
@@ -110,6 +110,7 @@ var spanishWords = {
110
110
  appActions: { deshacer: "undo", rehacer: "redo" },
111
111
  // el ejemplo de una página, en un dibujo (`example_block`, épica `elemental-spell` P16)
112
112
  exampleTag: "ejemplo",
113
+ quotedNameTags: { panel: "etiqueta" },
113
114
  // an app\'s widget defaults, sample tags (`ui_defaults`, epic `language` P29): Spell UI\'s word, in every language
114
115
  defaultsTag: "ui-defaults",
115
116
  /** Spell's own old words, each an error naming its new one (epic `elemental-spell` P27): a view's parts are slots. */
@@ -265,8 +266,7 @@ var spanishWords = {
265
266
  pestaña: "tab",
266
267
  pestana: "tab",
267
268
  etiquetas: "tags",
268
- ilustración: "picture",
269
- ilustracion: "picture",
269
+ miniatura: "thumbnail",
270
270
  fila: "row",
271
271
  columna: "column",
272
272
  color: "color"
@@ -323,6 +323,7 @@ var spanishWords = {
323
323
  menuBar: "su barra de menú es {quoted menu-bar}",
324
324
  group: "grupo {name}",
325
325
  pageLocked: 'su candado es "bloqueado"',
326
+ templateThumbnail: "su miniatura es {quoted thumbnail}",
326
327
  // Spell UI's Spanish words for `<ui-section label sticky="stack" collapsible dividing level>`
327
328
  pageSection: {
328
329
  tag: "seccion",
@@ -336,7 +337,7 @@ var spanishWords = {
336
337
  sitePageTab: ", pestaña {quoted tab}",
337
338
  sitePageTags: ", etiquetada {quoted tags}",
338
339
  sitePageState: ", {state}",
339
- sitePagePicture: ", ilustrada en {quoted picture}",
340
+ sitePageThumbnail: ", miniatura {quoted thumbnail}",
340
341
  siteCardPlace: ", en la fila {row} columna {column}",
341
342
  siteCardColor: ", de color {color}",
342
343
  siteOverlay: "tiene {a words} {words}",
@@ -425,7 +426,9 @@ var spanishWords = {
425
426
  timestamp: ["marca de tiempo"],
426
427
  selection: ["selección", "seleccion"],
427
428
  // una página bloqueada: `su candado es bloqueado` (épica `notebook` P1)
428
- lock: ["candado"]
429
+ lock: ["candado"],
430
+ // la imagen de una página o vista sin contenido (épica `mockup` P16)
431
+ thumbnail: ["miniatura"]
429
432
  },
430
433
  builtInMemberValues: {
431
434
  // lo que vale el candado de una página (épica `notebook` I1)
@@ -163,7 +163,7 @@ var _SpellStatement = class _SpellStatement extends (_a = P.Sequence, _operandIn
163
163
  if (!member.declarable) {
164
164
  return _SpellStatement.refuse(match, language.parserMessage("cant-add-built-in-member", params));
165
165
  }
166
- if (datatype && datatype !== member.datatype) {
166
+ if (datatype && datatype !== member.datatype && !member.anyDatatype) {
167
167
  const message = language.parserMessage("cant-retype-built-in-member", {
168
168
  ...params,
169
169
  datatype: language.wordFor(datatype),
@@ -50,6 +50,7 @@ var __privateMethod = (obj, member, method) => (__accessCheck(obj, member, "acce
50
50
  // src/spell/rules/classes/DrawSlot.ts
51
51
  import { proto } from "spell/util";
52
52
  import { P } from "../../../parser/index.js";
53
+ import { SP } from "../../index.js";
53
54
  import { Priority } from "../rules.types.js";
54
55
  import { Wording } from "../expressions/index.js";
55
56
  import { DrawIt } from "./index.js";
@@ -106,7 +107,11 @@ var _DrawSlot = class _DrawSlot extends (_a2 = SpellStatement, _alias_dec2 = [pr
106
107
  if (Wording.reads(scope, "draw_method", words, "draw_its_placeholder")) return void 0;
107
108
  const slot = DrawIt.slotName(`${match.groups.slot.value}`);
108
109
  const type = _DrawSlot.viewIn(scope);
109
- if (type && !type.hasSlot(slot) && type.getMember(`${match.groups.slot.value}`)) return void 0;
110
+ const member = type?.getMember(`${match.groups.slot.value}`);
111
+ if (type && !type.hasSlot(slot) && member) return void 0;
112
+ if (member instanceof P.ScopeVariable && member.datatype !== "text") {
113
+ if (SP.builtInStoredMember(type, `${match.groups.slot.value}`)?.member.anyDatatype) return void 0;
114
+ }
110
115
  match.data.slot = type?.slotOutput(slot) ?? slot;
111
116
  return match;
112
117
  }
@@ -4,8 +4,8 @@ import { type SitePageEntry } from "./sites.shared";
4
4
  /**
5
5
  * `site_page` rule: one of a site's pages, and its address (epic `mockup` P1).
6
6
  * - e.g. `- it has a film page at "/films/:film", named "Film"`, in a site's body
7
- * - e.g. `- it has a film page at "/films/:film", named "Film", old, pictured in "snapshots/film.png"`:
8
- * how far along it is, and a picture of it, a file of the project (epic `mockup` P13, T14)
7
+ * - e.g. `- it has a film page at "/films/:film", named "Film", old, thumbnail "snapshots/film.png"`:
8
+ * how far along it is, and a thumbnail of it, a file of the project (epic `mockup` P13, T14)
9
9
  * - e.g. `- it has a film page at "/films/:film", in row 2 column 3, colored blue`:
10
10
  * where its card sits in its section of the site editor's board, and its colour (epic `mockup` T31);
11
11
  * any part's line may end so
@@ -27,7 +27,7 @@ import { type SitePageEntry } from "./sites.shared";
27
27
  * - Only in a site's body; anywhere else, `it has a ...` is a property.
28
28
  * - Compiles to nothing by itself: `create_site` lists every page in its class, `static pages = [...]`.
29
29
  */
30
- export declare class SitePage extends SpellStatement<"type|part|address|title?|tab?|tags?|state?|picture?|row?|column?|color?|with_nested_statements?|body?", {
30
+ export declare class SitePage extends SpellStatement<"type|part|address|title?|tab?|tags?|state?|thumbnail?|row?|column?|color?|with_nested_statements?|body?", {
31
31
  entry?: SitePageEntry;
32
32
  }> {
33
33
  static priority: number;
@@ -98,7 +98,7 @@ var _SitePage = class _SitePage extends (_a = SpellStatement, _priority_dec = [p
98
98
  const tab = match.groups.tab ? textIn(match.groups.tab) : void 0;
99
99
  const tags = match.groups.tags ? tagsIn(textIn(match.groups.tags)) : void 0;
100
100
  const state = Wording.meaningOf(match.groups.state);
101
- const picture = match.groups.picture ? textIn(match.groups.picture) : void 0;
101
+ const thumbnail = match.groups.thumbnail ? textIn(match.groups.thumbnail) : void 0;
102
102
  const card = cardDetailsOf(match.groups);
103
103
  if (!card) return SpellStatement.refuse(match, cardPlaceMessage(language, match.groups));
104
104
  match.data.entry = {
@@ -109,7 +109,7 @@ var _SitePage = class _SitePage extends (_a = SpellStatement, _priority_dec = [p
109
109
  ...tab && { tab },
110
110
  ...tags?.length && { tags },
111
111
  ...state && { state },
112
- ...picture && { picture },
112
+ ...thumbnail && { thumbnail },
113
113
  ...card,
114
114
  ...params.length && { params }
115
115
  };