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.
- package/AGENTS.md +1 -1
- package/components.manifest.json +3216 -3160
- package/dist/hooks/use-ds-messages.d.ts +39 -0
- package/dist/lib/i18n.d.ts +39 -0
- package/dist/lib/i18n.js +117 -0
- package/dist/lib/template-syntax.d.ts +22 -0
- package/dist/lib/template-syntax.js +66 -0
- package/dist/motion.css +146 -0
- package/dist/styles.css +1699 -0
- package/dist/themes/chocolate.css +259 -0
- package/dist/themes/chocolate.fonts.css +2 -0
- package/dist/themes/chocolate.guide.md +30 -0
- package/dist/themes/chocolate.meta.json +61 -0
- package/dist/themes/chocolate.scoped.css +259 -0
- package/dist/themes/chocolate.tokens.json +49 -0
- package/dist/themes/fractalia.css +556 -0
- package/dist/themes/fractalia.fonts.css +3 -0
- package/dist/themes/fractalia.guide.md +86 -0
- package/dist/themes/fractalia.meta.json +112 -0
- package/dist/themes/fractalia.scoped.css +556 -0
- package/dist/themes/fractalia.tokens.json +39 -0
- package/dist/themes/friendly.css +375 -0
- package/dist/themes/friendly.fonts.css +2 -0
- package/dist/themes/friendly.guide.md +38 -0
- package/dist/themes/friendly.meta.json +82 -0
- package/dist/themes/friendly.scoped.css +375 -0
- package/dist/themes/friendly.tokens.json +45 -0
- package/dist/themes/lagoon.css +359 -0
- package/dist/themes/lagoon.fonts.css +2 -0
- package/dist/themes/lagoon.guide.md +47 -0
- package/dist/themes/lagoon.meta.json +85 -0
- package/dist/themes/lagoon.scoped.css +359 -0
- package/dist/themes/lagoon.tokens.json +49 -0
- package/dist/themes/liquid.css +510 -0
- package/dist/themes/liquid.fonts.css +7 -0
- package/dist/themes/liquid.guide.md +82 -0
- package/dist/themes/liquid.meta.json +134 -0
- package/dist/themes/liquid.scoped.css +510 -0
- package/dist/themes/liquid.tokens.json +47 -0
- package/dist/themes/matcha.css +259 -0
- package/dist/themes/matcha.fonts.css +2 -0
- package/dist/themes/matcha.guide.md +30 -0
- package/dist/themes/matcha.meta.json +61 -0
- package/dist/themes/matcha.scoped.css +259 -0
- package/dist/themes/matcha.tokens.json +49 -0
- package/dist/themes/qratia.css +264 -0
- package/dist/themes/qratia.fonts.css +2 -0
- package/dist/themes/qratia.guide.md +34 -0
- package/dist/themes/qratia.meta.json +49 -0
- package/dist/themes/qratia.scoped.css +264 -0
- package/dist/themes/qratia.tokens.json +49 -0
- package/dist/themes/stone.css +263 -0
- package/dist/themes/stone.fonts.css +2 -0
- package/dist/themes/stone.guide.md +30 -0
- package/dist/themes/stone.meta.json +47 -0
- package/dist/themes/stone.scoped.css +263 -0
- package/dist/themes/stone.tokens.json +49 -0
- package/dist/themes/tactile.css +596 -0
- package/dist/themes/tactile.fonts.css +3 -0
- package/dist/themes/tactile.guide.md +82 -0
- package/dist/themes/tactile.meta.json +182 -0
- package/dist/themes/tactile.scoped.css +596 -0
- package/dist/themes/tactile.tokens.json +42 -0
- package/dist/themes/twitter.css +364 -0
- package/dist/themes/twitter.fonts.css +6 -0
- package/dist/themes/twitter.guide.md +35 -0
- package/dist/themes/twitter.meta.json +90 -0
- package/dist/themes/twitter.scoped.css +364 -0
- package/dist/themes/twitter.tokens.json +45 -0
- package/dist/themes/y2k.css +259 -0
- package/dist/themes/y2k.fonts.css +2 -0
- package/dist/themes/y2k.guide.md +30 -0
- package/dist/themes/y2k.meta.json +59 -0
- package/dist/themes/y2k.scoped.css +259 -0
- package/dist/themes/y2k.tokens.json +49 -0
- package/dist/themes/zyro.css +442 -0
- package/dist/themes/zyro.fonts.css +2 -0
- package/dist/themes/zyro.guide.md +33 -0
- package/dist/themes/zyro.meta.json +74 -0
- package/dist/themes/zyro.scoped.css +442 -0
- package/dist/themes/zyro.tokens.json +46 -0
- package/dist/ui/accordion.js +1 -1
- package/dist/ui/alert-dialog.js +1 -1
- package/dist/ui/alert.js +2 -2
- package/dist/ui/attachment.js +1 -1
- package/dist/ui/auth-form.js +4 -4
- package/dist/ui/auth-layout.d.ts +3 -1
- package/dist/ui/auth-layout.js +7 -4
- package/dist/ui/auth-parts.js +4 -4
- package/dist/ui/avatar.js +1 -1
- package/dist/ui/ayuda.js +1 -1
- package/dist/ui/badge.d.ts +1 -1
- package/dist/ui/badge.js +1 -1
- package/dist/ui/banner.js +1 -1
- package/dist/ui/bottom-nav.js +1 -1
- package/dist/ui/breadcrumb.js +1 -1
- package/dist/ui/bubble.d.ts +1 -1
- package/dist/ui/bubble.js +3 -3
- package/dist/ui/button-group.js +1 -1
- package/dist/ui/button.d.ts +1 -1
- package/dist/ui/button.js +4 -4
- package/dist/ui/calendar.js +6 -6
- package/dist/ui/carousel.js +4 -4
- package/dist/ui/choice-card.js +1 -1
- package/dist/ui/combobox.js +4 -4
- package/dist/ui/command.js +2 -2
- package/dist/ui/content-card.js +2 -2
- package/dist/ui/context-menu.js +9 -9
- package/dist/ui/data-table.d.ts +13 -3
- package/dist/ui/data-table.js +164 -71
- package/dist/ui/date-picker.js +1 -1
- package/dist/ui/dialog.js +1 -1
- package/dist/ui/drawer.js +5 -5
- package/dist/ui/dropdown-menu.js +9 -9
- package/dist/ui/field.js +3 -3
- package/dist/ui/heatmap-grid.js +2 -2
- package/dist/ui/input-group.js +3 -3
- package/dist/ui/input-otp.js +1 -1
- package/dist/ui/instruction-editor.d.ts +51 -0
- package/dist/ui/instruction-editor.js +263 -0
- package/dist/ui/item.d.ts +1 -1
- package/dist/ui/item.js +1 -1
- package/dist/ui/marker.d.ts +1 -1
- package/dist/ui/marker.js +2 -2
- package/dist/ui/menubar.js +8 -8
- package/dist/ui/mfa-challenge.js +3 -3
- package/dist/ui/mfa-setup.js +1 -1
- package/dist/ui/navigation-menu.js +2 -2
- package/dist/ui/oauth-consent.js +3 -3
- package/dist/ui/pagination.js +2 -2
- package/dist/ui/panel.d.ts +1 -1
- package/dist/ui/panel.js +1 -0
- package/dist/ui/passkey-list.js +1 -1
- package/dist/ui/resizable.js +1 -1
- package/dist/ui/scroll-area.js +1 -1
- package/dist/ui/session-timeout.js +1 -1
- package/dist/ui/sheet.js +2 -2
- package/dist/ui/sidebar.js +7 -7
- package/dist/ui/sign-out-dialog.js +1 -1
- package/dist/ui/sparkline.d.ts +1 -1
- package/dist/ui/status-badge.d.ts +2 -2
- package/dist/ui/switch.js +1 -1
- package/dist/ui/table.js +2 -2
- package/dist/ui/tabs.d.ts +1 -1
- package/dist/ui/tabs.js +2 -2
- package/dist/ui/toast.js +3 -3
- package/dist/ui/toggle-group.js +1 -1
- package/dist/ui/toggle.js +3 -3
- package/dist/ui/tooltip.js +2 -2
- package/docs/CONTRACT.md +224 -224
- package/package.json +218 -188
- package/scripts/brand-core.mjs +20 -1
- package/scripts/cli.mjs +457 -457
- package/scripts/doctor.mjs +2 -0
- package/scripts/init.mjs +1 -1
- 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;
|
package/dist/lib/i18n.d.ts
CHANGED
|
@@ -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
|
+
};
|
package/dist/motion.css
ADDED
|
@@ -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
|
+
}
|