orbital-ds 0.30.0 → 0.35.0

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 (156) hide show
  1. package/AGENTS.md +1 -1
  2. package/components.manifest.json +3216 -3160
  3. package/dist/hooks/use-ds-messages.d.ts +39 -0
  4. package/dist/lib/i18n.d.ts +39 -0
  5. package/dist/lib/i18n.js +117 -0
  6. package/dist/lib/template-syntax.d.ts +22 -0
  7. package/dist/lib/template-syntax.js +66 -0
  8. package/dist/motion.css +146 -0
  9. package/dist/styles.css +1699 -0
  10. package/dist/themes/chocolate.css +259 -0
  11. package/dist/themes/chocolate.fonts.css +2 -0
  12. package/dist/themes/chocolate.guide.md +30 -0
  13. package/dist/themes/chocolate.meta.json +61 -0
  14. package/dist/themes/chocolate.scoped.css +259 -0
  15. package/dist/themes/chocolate.tokens.json +49 -0
  16. package/dist/themes/fractalia.css +556 -0
  17. package/dist/themes/fractalia.fonts.css +3 -0
  18. package/dist/themes/fractalia.guide.md +86 -0
  19. package/dist/themes/fractalia.meta.json +112 -0
  20. package/dist/themes/fractalia.scoped.css +556 -0
  21. package/dist/themes/fractalia.tokens.json +39 -0
  22. package/dist/themes/friendly.css +375 -0
  23. package/dist/themes/friendly.fonts.css +2 -0
  24. package/dist/themes/friendly.guide.md +38 -0
  25. package/dist/themes/friendly.meta.json +82 -0
  26. package/dist/themes/friendly.scoped.css +375 -0
  27. package/dist/themes/friendly.tokens.json +45 -0
  28. package/dist/themes/lagoon.css +359 -0
  29. package/dist/themes/lagoon.fonts.css +2 -0
  30. package/dist/themes/lagoon.guide.md +47 -0
  31. package/dist/themes/lagoon.meta.json +85 -0
  32. package/dist/themes/lagoon.scoped.css +359 -0
  33. package/dist/themes/lagoon.tokens.json +49 -0
  34. package/dist/themes/liquid.css +510 -0
  35. package/dist/themes/liquid.fonts.css +7 -0
  36. package/dist/themes/liquid.guide.md +82 -0
  37. package/dist/themes/liquid.meta.json +134 -0
  38. package/dist/themes/liquid.scoped.css +510 -0
  39. package/dist/themes/liquid.tokens.json +47 -0
  40. package/dist/themes/matcha.css +259 -0
  41. package/dist/themes/matcha.fonts.css +2 -0
  42. package/dist/themes/matcha.guide.md +30 -0
  43. package/dist/themes/matcha.meta.json +61 -0
  44. package/dist/themes/matcha.scoped.css +259 -0
  45. package/dist/themes/matcha.tokens.json +49 -0
  46. package/dist/themes/qratia.css +264 -0
  47. package/dist/themes/qratia.fonts.css +2 -0
  48. package/dist/themes/qratia.guide.md +34 -0
  49. package/dist/themes/qratia.meta.json +49 -0
  50. package/dist/themes/qratia.scoped.css +264 -0
  51. package/dist/themes/qratia.tokens.json +49 -0
  52. package/dist/themes/stone.css +263 -0
  53. package/dist/themes/stone.fonts.css +2 -0
  54. package/dist/themes/stone.guide.md +30 -0
  55. package/dist/themes/stone.meta.json +47 -0
  56. package/dist/themes/stone.scoped.css +263 -0
  57. package/dist/themes/stone.tokens.json +49 -0
  58. package/dist/themes/tactile.css +596 -0
  59. package/dist/themes/tactile.fonts.css +3 -0
  60. package/dist/themes/tactile.guide.md +82 -0
  61. package/dist/themes/tactile.meta.json +182 -0
  62. package/dist/themes/tactile.scoped.css +596 -0
  63. package/dist/themes/tactile.tokens.json +42 -0
  64. package/dist/themes/twitter.css +364 -0
  65. package/dist/themes/twitter.fonts.css +6 -0
  66. package/dist/themes/twitter.guide.md +35 -0
  67. package/dist/themes/twitter.meta.json +90 -0
  68. package/dist/themes/twitter.scoped.css +364 -0
  69. package/dist/themes/twitter.tokens.json +45 -0
  70. package/dist/themes/y2k.css +259 -0
  71. package/dist/themes/y2k.fonts.css +2 -0
  72. package/dist/themes/y2k.guide.md +30 -0
  73. package/dist/themes/y2k.meta.json +59 -0
  74. package/dist/themes/y2k.scoped.css +259 -0
  75. package/dist/themes/y2k.tokens.json +49 -0
  76. package/dist/themes/zyro.css +442 -0
  77. package/dist/themes/zyro.fonts.css +2 -0
  78. package/dist/themes/zyro.guide.md +33 -0
  79. package/dist/themes/zyro.meta.json +74 -0
  80. package/dist/themes/zyro.scoped.css +442 -0
  81. package/dist/themes/zyro.tokens.json +46 -0
  82. package/dist/ui/accordion.js +1 -1
  83. package/dist/ui/alert-dialog.js +1 -1
  84. package/dist/ui/alert.js +2 -2
  85. package/dist/ui/attachment.js +1 -1
  86. package/dist/ui/auth-form.js +4 -4
  87. package/dist/ui/auth-layout.d.ts +3 -1
  88. package/dist/ui/auth-layout.js +7 -4
  89. package/dist/ui/auth-parts.js +4 -4
  90. package/dist/ui/avatar.js +1 -1
  91. package/dist/ui/ayuda.js +1 -1
  92. package/dist/ui/badge.d.ts +1 -1
  93. package/dist/ui/badge.js +1 -1
  94. package/dist/ui/banner.js +1 -1
  95. package/dist/ui/bottom-nav.js +1 -1
  96. package/dist/ui/breadcrumb.js +1 -1
  97. package/dist/ui/bubble.d.ts +1 -1
  98. package/dist/ui/bubble.js +3 -3
  99. package/dist/ui/button-group.js +1 -1
  100. package/dist/ui/button.d.ts +1 -1
  101. package/dist/ui/button.js +4 -4
  102. package/dist/ui/calendar.js +6 -6
  103. package/dist/ui/carousel.js +4 -4
  104. package/dist/ui/choice-card.js +1 -1
  105. package/dist/ui/combobox.js +4 -4
  106. package/dist/ui/command.js +2 -2
  107. package/dist/ui/content-card.js +2 -2
  108. package/dist/ui/context-menu.js +9 -9
  109. package/dist/ui/data-table.d.ts +13 -3
  110. package/dist/ui/data-table.js +164 -71
  111. package/dist/ui/date-picker.js +1 -1
  112. package/dist/ui/dialog.js +1 -1
  113. package/dist/ui/drawer.js +5 -5
  114. package/dist/ui/dropdown-menu.js +9 -9
  115. package/dist/ui/field.js +3 -3
  116. package/dist/ui/heatmap-grid.js +2 -2
  117. package/dist/ui/input-group.js +3 -3
  118. package/dist/ui/input-otp.js +1 -1
  119. package/dist/ui/instruction-editor.d.ts +51 -0
  120. package/dist/ui/instruction-editor.js +263 -0
  121. package/dist/ui/item.d.ts +1 -1
  122. package/dist/ui/item.js +1 -1
  123. package/dist/ui/marker.d.ts +1 -1
  124. package/dist/ui/marker.js +2 -2
  125. package/dist/ui/menubar.js +8 -8
  126. package/dist/ui/mfa-challenge.js +3 -3
  127. package/dist/ui/mfa-setup.js +1 -1
  128. package/dist/ui/navigation-menu.js +2 -2
  129. package/dist/ui/oauth-consent.js +3 -3
  130. package/dist/ui/pagination.js +2 -2
  131. package/dist/ui/panel.d.ts +1 -1
  132. package/dist/ui/panel.js +1 -0
  133. package/dist/ui/passkey-list.js +1 -1
  134. package/dist/ui/resizable.js +1 -1
  135. package/dist/ui/scroll-area.js +1 -1
  136. package/dist/ui/session-timeout.js +1 -1
  137. package/dist/ui/sheet.js +2 -2
  138. package/dist/ui/sidebar.js +7 -7
  139. package/dist/ui/sign-out-dialog.js +1 -1
  140. package/dist/ui/sparkline.d.ts +1 -1
  141. package/dist/ui/status-badge.d.ts +2 -2
  142. package/dist/ui/switch.js +1 -1
  143. package/dist/ui/table.js +2 -2
  144. package/dist/ui/tabs.d.ts +1 -1
  145. package/dist/ui/tabs.js +2 -2
  146. package/dist/ui/toast.js +3 -3
  147. package/dist/ui/toggle-group.js +1 -1
  148. package/dist/ui/toggle.js +3 -3
  149. package/dist/ui/tooltip.js +2 -2
  150. package/docs/CONTRACT.md +224 -224
  151. package/package.json +218 -188
  152. package/scripts/brand-core.mjs +20 -1
  153. package/scripts/cli.mjs +457 -457
  154. package/scripts/doctor.mjs +2 -0
  155. package/scripts/init.mjs +1 -1
  156. package/scripts/manifest.mjs +100 -100
@@ -148,6 +148,45 @@ declare const DsMessagesContext: React.Context<{
148
148
  heatmapHigh: string;
149
149
  dataTableFilter: string;
150
150
  dataTableLoading: string;
151
+ editorToolbar: string;
152
+ editorBold: string;
153
+ editorItalic: string;
154
+ editorStrike: string;
155
+ editorCode: string;
156
+ editorHeading: string;
157
+ editorBulletList: string;
158
+ editorOrderedList: string;
159
+ editorQuote: string;
160
+ editorCodeBlock: string;
161
+ editorUndo: string;
162
+ editorRedo: string;
163
+ editorVariables: string;
164
+ editorModes: string;
165
+ editorModeVisual: string;
166
+ editorModeMarkdown: string;
167
+ editorModeHtml: string;
168
+ editorModePreview: string;
169
+ editorPlaceholder: string;
170
+ editorCount: string;
171
+ editorSnippets: string;
172
+ editorSnippetDefault: string;
173
+ editorSnippetTernary: string;
174
+ editorSnippetIf: string;
175
+ editorSnippetIfElse: string;
176
+ editorSnippetUnless: string;
177
+ editorIssues: string;
178
+ editorIssueCondition: string;
179
+ editorIssueUnclosed: string;
180
+ editorIssueStray: string;
181
+ editorIssueSyntax: string;
182
+ editorIssueVariable: string;
183
+ editorPreviewSent: string;
184
+ editorPreviewEmpty: string;
185
+ editorStats: string;
186
+ dataTableExpandRow: string;
187
+ dataTableCollapseRow: string;
188
+ dataTableExpandGroup: string;
189
+ dataTableCollapseGroup: string;
151
190
  dropzoneTooMany: string;
152
191
  calendarPrevious: string;
153
192
  calendarNext: string;
@@ -147,6 +147,45 @@ declare const en: {
147
147
  heatmapHigh: string;
148
148
  dataTableFilter: string;
149
149
  dataTableLoading: string;
150
+ editorToolbar: string;
151
+ editorBold: string;
152
+ editorItalic: string;
153
+ editorStrike: string;
154
+ editorCode: string;
155
+ editorHeading: string;
156
+ editorBulletList: string;
157
+ editorOrderedList: string;
158
+ editorQuote: string;
159
+ editorCodeBlock: string;
160
+ editorUndo: string;
161
+ editorRedo: string;
162
+ editorVariables: string;
163
+ editorModes: string;
164
+ editorModeVisual: string;
165
+ editorModeMarkdown: string;
166
+ editorModeHtml: string;
167
+ editorModePreview: string;
168
+ editorPlaceholder: string;
169
+ editorCount: string;
170
+ editorSnippets: string;
171
+ editorSnippetDefault: string;
172
+ editorSnippetTernary: string;
173
+ editorSnippetIf: string;
174
+ editorSnippetIfElse: string;
175
+ editorSnippetUnless: string;
176
+ editorIssues: string;
177
+ editorIssueCondition: string;
178
+ editorIssueUnclosed: string;
179
+ editorIssueStray: string;
180
+ editorIssueSyntax: string;
181
+ editorIssueVariable: string;
182
+ editorPreviewSent: string;
183
+ editorPreviewEmpty: string;
184
+ editorStats: string;
185
+ dataTableExpandRow: string;
186
+ dataTableCollapseRow: string;
187
+ dataTableExpandGroup: string;
188
+ dataTableCollapseGroup: string;
150
189
  dropzoneTooMany: string;
151
190
  calendarPrevious: string;
152
191
  calendarNext: string;
package/dist/lib/i18n.js CHANGED
@@ -146,6 +146,45 @@ const en = {
146
146
  heatmapHigh: "High",
147
147
  dataTableFilter: "Filter",
148
148
  dataTableLoading: "Loading data",
149
+ editorToolbar: "Formatting",
150
+ editorBold: "Bold",
151
+ editorItalic: "Italic",
152
+ editorStrike: "Strikethrough",
153
+ editorCode: "Inline code",
154
+ editorHeading: "Heading",
155
+ editorBulletList: "Bulleted list",
156
+ editorOrderedList: "Numbered list",
157
+ editorQuote: "Quote",
158
+ editorCodeBlock: "Code block",
159
+ editorUndo: "Undo",
160
+ editorRedo: "Redo",
161
+ editorVariables: "Variables",
162
+ editorModes: "Editor view",
163
+ editorModeVisual: "Visual",
164
+ editorModeMarkdown: "Markdown",
165
+ editorModeHtml: "HTML",
166
+ editorModePreview: "Preview",
167
+ editorPlaceholder: "Write here\u2026",
168
+ editorCount: "{count} characters",
169
+ editorSnippets: "Logic",
170
+ editorSnippetDefault: "Default value",
171
+ editorSnippetTernary: "Yes/no value",
172
+ editorSnippetIf: "If",
173
+ editorSnippetIfElse: "If / else",
174
+ editorSnippetUnless: "Unless",
175
+ editorIssues: "Template warnings",
176
+ editorIssueCondition: "Line {line}: condition \xAB{text}\xBB is not recognized; it is evaluated as false.",
177
+ editorIssueUnclosed: "Line {line}: {text} is never closed.",
178
+ editorIssueStray: "Line {line}: {text} has no matching opening.",
179
+ editorIssueSyntax: "Line {line}: {text} is not valid and is left as written.",
180
+ editorIssueVariable: "Line {line}: variable \xAB{text}\xBB is not in the list.",
181
+ editorPreviewSent: "What the model receives",
182
+ editorPreviewEmpty: "Nothing to show yet.",
183
+ editorStats: "Size",
184
+ dataTableExpandRow: "Expand row",
185
+ dataTableCollapseRow: "Collapse row",
186
+ dataTableExpandGroup: "Expand group {group}",
187
+ dataTableCollapseGroup: "Collapse group {group}",
149
188
  dropzoneTooMany: "{name}: up to {n} files",
150
189
  calendarPrevious: "Previous month",
151
190
  calendarNext: "Next month",
@@ -527,6 +566,45 @@ const es = {
527
566
  heatmapHigh: "Alto",
528
567
  dataTableFilter: "Filtrar",
529
568
  dataTableLoading: "Cargando datos",
569
+ editorToolbar: "Formato",
570
+ editorBold: "Negrita",
571
+ editorItalic: "Cursiva",
572
+ editorStrike: "Tachado",
573
+ editorCode: "C\xF3digo en l\xEDnea",
574
+ editorHeading: "T\xEDtulo",
575
+ editorBulletList: "Lista con vi\xF1etas",
576
+ editorOrderedList: "Lista numerada",
577
+ editorQuote: "Cita",
578
+ editorCodeBlock: "Bloque de c\xF3digo",
579
+ editorUndo: "Deshacer",
580
+ editorRedo: "Rehacer",
581
+ editorVariables: "Variables",
582
+ editorModes: "Vista del editor",
583
+ editorModeVisual: "Visual",
584
+ editorModeMarkdown: "Markdown",
585
+ editorModeHtml: "HTML",
586
+ editorModePreview: "Vista previa",
587
+ editorPlaceholder: "Escribe aqu\xED\u2026",
588
+ editorCount: "{count} caracteres",
589
+ editorSnippets: "L\xF3gica",
590
+ editorSnippetDefault: "Valor por defecto",
591
+ editorSnippetTernary: "Valor s\xED/no",
592
+ editorSnippetIf: "Si",
593
+ editorSnippetIfElse: "Si / si no",
594
+ editorSnippetUnless: "Salvo si",
595
+ editorIssues: "Avisos de la plantilla",
596
+ editorIssueCondition: "L\xEDnea {line}: la condici\xF3n \xAB{text}\xBB no se reconoce; se eval\xFAa como falsa.",
597
+ editorIssueUnclosed: "L\xEDnea {line}: {text} no se cierra nunca.",
598
+ editorIssueStray: "L\xEDnea {line}: {text} no tiene su apertura.",
599
+ editorIssueSyntax: "L\xEDnea {line}: {text} no es v\xE1lido y se deja tal cual.",
600
+ editorIssueVariable: "L\xEDnea {line}: la variable \xAB{text}\xBB no est\xE1 en la lista.",
601
+ editorPreviewSent: "Lo que recibe el modelo",
602
+ editorPreviewEmpty: "A\xFAn no hay nada que mostrar.",
603
+ editorStats: "Tama\xF1o",
604
+ dataTableExpandRow: "Expandir fila",
605
+ dataTableCollapseRow: "Contraer fila",
606
+ dataTableExpandGroup: "Expandir grupo {group}",
607
+ dataTableCollapseGroup: "Contraer grupo {group}",
530
608
  dropzoneTooMany: "{name}: m\xE1ximo {n} ficheros",
531
609
  calendarPrevious: "Mes anterior",
532
610
  calendarNext: "Mes siguiente",
@@ -908,6 +986,45 @@ const ptBR = {
908
986
  heatmapHigh: "Alto",
909
987
  dataTableFilter: "Filtrar",
910
988
  dataTableLoading: "Carregando dados",
989
+ editorToolbar: "Formata\xE7\xE3o",
990
+ editorBold: "Negrito",
991
+ editorItalic: "It\xE1lico",
992
+ editorStrike: "Tachado",
993
+ editorCode: "C\xF3digo em linha",
994
+ editorHeading: "T\xEDtulo",
995
+ editorBulletList: "Lista com marcadores",
996
+ editorOrderedList: "Lista numerada",
997
+ editorQuote: "Cita\xE7\xE3o",
998
+ editorCodeBlock: "Bloco de c\xF3digo",
999
+ editorUndo: "Desfazer",
1000
+ editorRedo: "Refazer",
1001
+ editorVariables: "Vari\xE1veis",
1002
+ editorModes: "Visualiza\xE7\xE3o do editor",
1003
+ editorModeVisual: "Visual",
1004
+ editorModeMarkdown: "Markdown",
1005
+ editorModeHtml: "HTML",
1006
+ editorModePreview: "Pr\xE9-visualiza\xE7\xE3o",
1007
+ editorPlaceholder: "Escreva aqui\u2026",
1008
+ editorCount: "{count} caracteres",
1009
+ editorSnippets: "L\xF3gica",
1010
+ editorSnippetDefault: "Valor padr\xE3o",
1011
+ editorSnippetTernary: "Valor sim/n\xE3o",
1012
+ editorSnippetIf: "Se",
1013
+ editorSnippetIfElse: "Se / sen\xE3o",
1014
+ editorSnippetUnless: "Exceto se",
1015
+ editorIssues: "Avisos do modelo",
1016
+ editorIssueCondition: "Linha {line}: a condi\xE7\xE3o \xAB{text}\xBB n\xE3o \xE9 reconhecida; \xE9 avaliada como falsa.",
1017
+ editorIssueUnclosed: "Linha {line}: {text} nunca \xE9 fechado.",
1018
+ editorIssueStray: "Linha {line}: {text} n\xE3o tem a abertura correspondente.",
1019
+ editorIssueSyntax: "Linha {line}: {text} n\xE3o \xE9 v\xE1lido e fica como est\xE1.",
1020
+ editorIssueVariable: "Linha {line}: a vari\xE1vel \xAB{text}\xBB n\xE3o est\xE1 na lista.",
1021
+ editorPreviewSent: "O que o modelo recebe",
1022
+ editorPreviewEmpty: "Ainda n\xE3o h\xE1 nada para mostrar.",
1023
+ editorStats: "Tamanho",
1024
+ dataTableExpandRow: "Expandir linha",
1025
+ dataTableCollapseRow: "Recolher linha",
1026
+ dataTableExpandGroup: "Expandir grupo {group}",
1027
+ dataTableCollapseGroup: "Recolher grupo {group}",
911
1028
  dropzoneTooMany: "{name}: m\xE1ximo de {n} arquivos",
912
1029
  calendarPrevious: "M\xEAs anterior",
913
1030
  calendarNext: "Pr\xF3ximo m\xEAs",
@@ -0,0 +1,22 @@
1
+ type TemplateIssueCode = "condition" | "unclosed" | "stray" | "syntax" | "variable";
2
+ interface TemplateIssue {
3
+ code: TemplateIssueCode;
4
+ /** Texto que causa el aviso (condición, marcador o variable). */
5
+ text: string;
6
+ /** Línea, desde 1. */
7
+ line: number;
8
+ }
9
+ declare function isValidCondition(cond: string): boolean;
10
+ /** Revisa una plantilla. `variables` (opcional) activa el aviso de variables desconocidas. */
11
+ declare function analyzeTemplate(source: string, variables?: readonly string[]): TemplateIssue[];
12
+ /** Fragmentos que la barra puede insertar. */
13
+ declare const TEMPLATE_SNIPPETS: {
14
+ readonly default: "{{variable | \"default\"}}";
15
+ readonly ternary: "{{variable ? \"yes\" : \"no\"}}";
16
+ readonly if: "[[IF variable]]\n\n[[/IF]]";
17
+ readonly ifElse: "[[IF variable]]\n\n[[ELSE]]\n\n[[/IF]]";
18
+ readonly unless: "[[UNLESS variable]]\n\n[[/UNLESS]]";
19
+ };
20
+ type TemplateSnippet = keyof typeof TEMPLATE_SNIPPETS;
21
+
22
+ export { TEMPLATE_SNIPPETS, type TemplateIssue, type TemplateIssueCode, type TemplateSnippet, analyzeTemplate, isValidCondition };
@@ -0,0 +1,66 @@
1
+ const COND_RES = [
2
+ /^\w+$/,
3
+ /^(\w+)\s*(==|!=)\s*(true|false)$/,
4
+ /^(\w+)\s*(==|!=)\s*"(.+)"$/,
5
+ /^(\w+)\s*(>=|<=|>|<)\s*(\d+)$/
6
+ ];
7
+ function isValidCondition(cond) {
8
+ const c = cond.trim();
9
+ return COND_RES.some((re) => re.test(c));
10
+ }
11
+ const lineOf = (src, index) => src.slice(0, index).split("\n").length;
12
+ function analyzeTemplate(source, variables) {
13
+ const issues = [];
14
+ const known = variables ? new Set(variables) : null;
15
+ const checkVar = (name, index) => {
16
+ if (known && !known.has(name)) issues.push({ code: "variable", text: name, line: lineOf(source, index) });
17
+ };
18
+ const stack = [];
19
+ const blockRe = /\[\[(IF\s+(.+?)|UNLESS\s+(\w+)|ELSE|\/IF|\/UNLESS)\]\]/gi;
20
+ for (const m of source.matchAll(blockRe)) {
21
+ const tag = m[1].toUpperCase();
22
+ const index = m.index ?? 0;
23
+ if (tag.startsWith("IF")) {
24
+ const cond = m[2].trim();
25
+ stack.push({ kind: "IF", index, text: cond });
26
+ if (!isValidCondition(cond)) issues.push({ code: "condition", text: cond, line: lineOf(source, index) });
27
+ const v = cond.match(/^\w+/)?.[0];
28
+ if (v && isValidCondition(cond)) checkVar(v, index);
29
+ } else if (tag.startsWith("UNLESS")) {
30
+ stack.push({ kind: "UNLESS", index, text: m[3] });
31
+ checkVar(m[3], index);
32
+ } else if (tag === "ELSE") {
33
+ if (stack.at(-1)?.kind !== "IF") issues.push({ code: "stray", text: "[[ELSE]]", line: lineOf(source, index) });
34
+ } else {
35
+ const kind = tag === "/IF" ? "IF" : "UNLESS";
36
+ if (stack.at(-1)?.kind === kind) stack.pop();
37
+ else issues.push({ code: "stray", text: `[[${tag}]]`, line: lineOf(source, index) });
38
+ }
39
+ }
40
+ for (const open of stack) {
41
+ issues.push({ code: "unclosed", text: `[[${open.kind} ${open.text}]]`, line: lineOf(source, open.index) });
42
+ }
43
+ for (const m of source.matchAll(/\[\[(?:IF|UNLESS)\b(?![^\]\n]*\]\])/gi)) {
44
+ issues.push({ code: "syntax", text: m[0], line: lineOf(source, m.index ?? 0) });
45
+ }
46
+ for (const m of source.matchAll(/\{\{([^{}\n]*)\}\}/g)) {
47
+ const body = m[1];
48
+ const index = m.index ?? 0;
49
+ const name = body.match(/^(\w+)\s*(?:$|\?\s*"[^"]*"\s*:\s*"[^"]*"$|\|\s*"[^"]*"$)/)?.[1];
50
+ if (name) checkVar(name, index);
51
+ else issues.push({ code: "syntax", text: m[0], line: lineOf(source, index) });
52
+ }
53
+ return issues.sort((a, b) => a.line - b.line);
54
+ }
55
+ const TEMPLATE_SNIPPETS = {
56
+ default: '{{variable | "default"}}',
57
+ ternary: '{{variable ? "yes" : "no"}}',
58
+ if: "[[IF variable]]\n\n[[/IF]]",
59
+ ifElse: "[[IF variable]]\n\n[[ELSE]]\n\n[[/IF]]",
60
+ unless: "[[UNLESS variable]]\n\n[[/UNLESS]]"
61
+ };
62
+ export {
63
+ TEMPLATE_SNIPPETS,
64
+ analyzeTemplate,
65
+ isValidCondition
66
+ };
@@ -0,0 +1,146 @@
1
+ /*
2
+ * orbital-ds · MOVIMIENTO AUTOMÁTICO (opcional): animaciones de fábrica sin escribir código.
3
+ *
4
+ * @import 'orbital-ds/motion.css'; (después del tema, en el CSS de la app)
5
+ *
6
+ * Qué hace, con el ritmo y la coreografía del TEMA activo (--ds-motion-*, --ds-ease-*,
7
+ * --ds-motion-distance, -scale, -blur, -stagger, -press-scale, --ds-hover-lift):
8
+ * - ENTRADA: tarjetas, paneles, KPI, filas-tarjeta, avisos, cabeceras de página y filas de
9
+ * tabla aparecen subiendo y fundiéndose, en CASCADA entre hermanas.
10
+ * - SUPERFICIES PULSABLES (tarjeta o fila-tarjeta que es enlace o botón): al pasar, la sombra
11
+ * de hover del tema y su elevación; al pulsar, se hunden un poco.
12
+ * - Movimiento reducido: no anima nada (y la regla global de la estructura lo refuerza).
13
+ *
14
+ * Interruptores por grupo (variables de la estructura; el tema los fija y la app los cambia en
15
+ * brand.css): --ds-enter-surfaces (tarjetas, paneles, KPI, filas-tarjeta), --ds-enter-notices
16
+ * (avisos, banners, vacíos), --ds-enter-headers (cabeceras) y --ds-enter-rows (filas de tabla y
17
+ * línea de tiempo). Valor: ds-auto-enter (anima) o none (apagado). La ficha del tema lo describe
18
+ * en motion.auto.
19
+ *
20
+ * Todo con :where() (especificidad cero): un tema o una app lo ajustan sin pelear. Para quitarlo
21
+ * en una pieza concreta: class="animate-none" o style="animation: none".
22
+ * Motion (motion.dev) sigue siendo la vía para coreografías a medida (DsMotionProvider + useDsMotion).
23
+ */
24
+
25
+ @media (prefers-reduced-motion: no-preference) {
26
+ /* ── Entrada (cada grupo, con su interruptor: none lo apaga) ───────────── */
27
+ /* Una entrada de lado o con desplazamiento no debe crear scroll horizontal mientras dura
28
+ (clip no crea contenedor de scroll: el sticky y el scroll de la página siguen igual). */
29
+ :where(body) {
30
+ overflow-x: clip;
31
+ }
32
+ /* `backwards`, no `both`: al terminar no queda ningún efecto vivo (ni contexto de apilado ni
33
+ bloque contenedor para hijos fixed/sticky) y el hover del tema manda sobre translate/scale. */
34
+ :where([data-slot='card'], [data-slot='panel'], [data-slot='stat'], [data-slot='item'][data-variant='card']) {
35
+ animation: var(--ds-enter-surfaces) var(--ds-motion-base) var(--ds-ease-enter) backwards;
36
+ }
37
+ :where([data-slot='alert'], [data-slot='banner'], [data-slot='empty']) {
38
+ animation: var(--ds-enter-notices) var(--ds-motion-base) var(--ds-ease-enter) backwards;
39
+ }
40
+ :where([data-slot='page-header'], [data-slot='section-header'], [data-slot='app-header']) {
41
+ animation: var(--ds-enter-headers) var(--ds-motion-base) var(--ds-ease-enter) backwards;
42
+ }
43
+ :where([data-slot='timeline-item'], [data-slot='table-body'] > [data-slot='table-row']) {
44
+ animation: var(--ds-enter-rows) var(--ds-motion-base) var(--ds-ease-enter) backwards;
45
+ }
46
+
47
+ /* Cascada entre hermanas: cada una, un paso de --ds-motion-stagger más tarde (hasta 10). */
48
+ :where(
49
+ [data-slot='card'],
50
+ [data-slot='panel'],
51
+ [data-slot='stat'],
52
+ [data-slot='item'][data-variant='card'],
53
+ [data-slot='timeline-item'],
54
+ [data-slot='table-body'] > [data-slot='table-row']
55
+ ) {
56
+ &:nth-child(2) { animation-delay: calc(var(--ds-motion-stagger) * 1); }
57
+ &:nth-child(3) { animation-delay: calc(var(--ds-motion-stagger) * 2); }
58
+ &:nth-child(4) { animation-delay: calc(var(--ds-motion-stagger) * 3); }
59
+ &:nth-child(5) { animation-delay: calc(var(--ds-motion-stagger) * 4); }
60
+ &:nth-child(6) { animation-delay: calc(var(--ds-motion-stagger) * 5); }
61
+ &:nth-child(7) { animation-delay: calc(var(--ds-motion-stagger) * 6); }
62
+ &:nth-child(8) { animation-delay: calc(var(--ds-motion-stagger) * 7); }
63
+ &:nth-child(9) { animation-delay: calc(var(--ds-motion-stagger) * 8); }
64
+ &:nth-child(n + 10) { animation-delay: calc(var(--ds-motion-stagger) * 9); }
65
+ }
66
+
67
+ /* Filas-tarjeta dentro de un ItemGroup: cada una va en su envoltorio role="listitem", así que la
68
+ cascada cuenta los envoltorios. */
69
+ :where([data-slot='item-listitem']) {
70
+ &:nth-child(2) > [data-slot='item'][data-variant='card'] { animation-delay: calc(var(--ds-motion-stagger) * 1); }
71
+ &:nth-child(3) > [data-slot='item'][data-variant='card'] { animation-delay: calc(var(--ds-motion-stagger) * 2); }
72
+ &:nth-child(4) > [data-slot='item'][data-variant='card'] { animation-delay: calc(var(--ds-motion-stagger) * 3); }
73
+ &:nth-child(5) > [data-slot='item'][data-variant='card'] { animation-delay: calc(var(--ds-motion-stagger) * 4); }
74
+ &:nth-child(6) > [data-slot='item'][data-variant='card'] { animation-delay: calc(var(--ds-motion-stagger) * 5); }
75
+ &:nth-child(7) > [data-slot='item'][data-variant='card'] { animation-delay: calc(var(--ds-motion-stagger) * 6); }
76
+ &:nth-child(8) > [data-slot='item'][data-variant='card'] { animation-delay: calc(var(--ds-motion-stagger) * 7); }
77
+ &:nth-child(9) > [data-slot='item'][data-variant='card'] { animation-delay: calc(var(--ds-motion-stagger) * 8); }
78
+ &:nth-child(n + 10) > [data-slot='item'][data-variant='card'] { animation-delay: calc(var(--ds-motion-stagger) * 9); }
79
+ }
80
+
81
+ /* ── Superficies pulsables ───────────────────────────────────────────────── */
82
+ :where(
83
+ a[data-slot='card'],
84
+ button[data-slot='card'],
85
+ a[data-slot='item'][data-variant='card'],
86
+ button[data-slot='item'][data-variant='card']
87
+ ) {
88
+ transition:
89
+ box-shadow var(--ds-motion-fast) var(--ds-ease-standard),
90
+ translate var(--ds-motion-fast) var(--ds-ease-standard),
91
+ scale var(--ds-motion-fast) var(--ds-ease-standard);
92
+
93
+ &:hover {
94
+ box-shadow: var(--ds-shadow-card-hover);
95
+ translate: 0 calc(var(--ds-hover-lift) * -1);
96
+ }
97
+ &:active {
98
+ scale: var(--ds-motion-press-scale);
99
+ }
100
+ }
101
+ }
102
+
103
+ /* ── CATÁLOGO de entradas (nombres fijos: el tema elige una por grupo; el doctor lo comprueba) ──
104
+ * Todas toman recorrido, escala y desenfoque del tema; la curva (con o sin rebote), de --ds-ease-enter. */
105
+ :root {
106
+ --ds-dir: 1;
107
+ }
108
+ [dir='rtl'] {
109
+ --ds-dir: -1;
110
+ }
111
+ /* sube y aparece (por defecto) */
112
+ @keyframes ds-auto-enter {
113
+ from {
114
+ opacity: 0;
115
+ translate: 0 var(--ds-motion-distance);
116
+ scale: var(--ds-motion-scale);
117
+ filter: blur(var(--ds-motion-blur));
118
+ }
119
+ }
120
+ /* solo aparece */
121
+ @keyframes ds-auto-fade {
122
+ from {
123
+ opacity: 0;
124
+ }
125
+ }
126
+ /* crece desde un poco más pequeño (con rebote si la curva del tema lo tiene) */
127
+ @keyframes ds-auto-pop {
128
+ from {
129
+ opacity: 0;
130
+ scale: var(--ds-motion-scale);
131
+ }
132
+ }
133
+ /* entra de lado, desde el inicio de la línea (respeta RTL) */
134
+ @keyframes ds-auto-slide {
135
+ from {
136
+ opacity: 0;
137
+ translate: calc(var(--ds-motion-distance) * -1 * var(--ds-dir)) 0;
138
+ }
139
+ }
140
+ /* se enfoca desde desenfocado (cristal) */
141
+ @keyframes ds-auto-focus {
142
+ from {
143
+ opacity: 0;
144
+ filter: blur(max(var(--ds-motion-blur), var(--ds-motion-focus-blur)));
145
+ }
146
+ }