@tristan2828/ui-foundation 4.64.0 → 4.66.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 (30) hide show
  1. package/conventions/docs/add-an-entity.md +99 -47
  2. package/conventions/docs/cell-patterns.md +1 -1
  3. package/conventions/docs/entity-plan-template.md +11 -4
  4. package/dist/components/app/data-table.d.ts +32 -1
  5. package/dist/components/app/data-table.js +59 -13
  6. package/dist/components/app/markdown.d.ts +4 -3
  7. package/dist/components/app/markdown.js +15 -8
  8. package/dist/components/app/milkdown-editor.js +39 -10
  9. package/dist/components/app/notes-outline.js +3 -2
  10. package/dist/components/app/record-dialog.d.ts +8 -1
  11. package/dist/components/app/record-dialog.js +16 -4
  12. package/dist/components/app/rich-text-editor.d.ts +4 -3
  13. package/dist/components/app/rich-text-editor.js +5 -2
  14. package/dist/components/app/rich-text-fold.js +1 -1
  15. package/dist/components/app/rich-text-format-items.d.ts +6 -0
  16. package/dist/components/app/rich-text-format-items.js +13 -1
  17. package/dist/components/app/rich-text-formats.d.ts +6 -1
  18. package/dist/components/app/rich-text-formats.js +22 -5
  19. package/dist/components/app/rich-text-slash-menu.js +1 -1
  20. package/dist/components/app/rich-text-slash.js +9 -5
  21. package/dist/components/app/rich-text-toggle-heading.d.ts +8 -0
  22. package/dist/components/app/rich-text-toggle-heading.js +55 -0
  23. package/dist/index.d.ts +1 -1
  24. package/dist/lib/markdown-fold.d.ts +5 -2
  25. package/dist/lib/markdown-fold.js +24 -10
  26. package/dist/lib/markdown-toggle.d.ts +29 -0
  27. package/dist/lib/markdown-toggle.js +69 -0
  28. package/eslint/index.d.ts +6 -1
  29. package/eslint/index.js +18 -2
  30. package/package.json +1 -1
package/eslint/index.js CHANGED
@@ -64,6 +64,16 @@ export const NO_BARE_FETCH = {
64
64
  'Do not call fetch directly. All server state goes through TanStack Query, which calls src/api/gateway/, which builds on the foundation gateway entry point.',
65
65
  }
66
66
 
67
+ // Every list says how its rows open their records (DataTable's `opens`:
68
+ // a dialog, a dialog only, its page, the panel, or edited in its rows), so
69
+ // a change to how the foundation opens a record reaches every list. On in
70
+ // an app with `uiFoundation({ requireTableOpens: true })`.
71
+ export const TABLE_OPENS = {
72
+ selector: "JSXOpeningElement[name.name='DataTable']:not(:has(JSXAttribute[name.name='opens']))",
73
+ message:
74
+ "Say how this list opens a record: DataTable's `opens` (dialog, dialog-only, page, panel or rows). See add-an-entity.md \"How a list opens a record\".",
75
+ }
76
+
67
77
  // The rules every TypeScript file gets, before any boundary rule.
68
78
  export function baseConfig() {
69
79
  return {
@@ -121,7 +131,8 @@ function appImportPatterns({ allowGateway }) {
121
131
 
122
132
  /**
123
133
  * The lint config for an app built on the foundation.
124
- * @param {{ ignores?: string[] }} [options] extra paths to ignore, on top of build output and generated files
134
+ * @param {{ ignores?: string[], requireTableOpens?: boolean }} [options] `ignores`: extra paths to ignore, on top
135
+ * of build output and generated files; `requireTableOpens`: every DataTable must say how it opens a record (`opens`)
125
136
  */
126
137
  export default function uiFoundation(options = {}) {
127
138
  return defineConfig([
@@ -140,7 +151,12 @@ export default function uiFoundation(options = {}) {
140
151
  {
141
152
  ...baseConfig(),
142
153
  rules: {
143
- 'no-restricted-syntax': ['error', ...TOKEN_SYNTAX_RULES, NO_BARE_FETCH],
154
+ 'no-restricted-syntax': [
155
+ 'error',
156
+ ...TOKEN_SYNTAX_RULES,
157
+ NO_BARE_FETCH,
158
+ ...(options.requireTableOpens ? [TABLE_OPENS] : []),
159
+ ],
144
160
  'no-restricted-imports': ['error', { patterns: appImportPatterns({ allowGateway: false }) }],
145
161
  },
146
162
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tristan2828/ui-foundation",
3
- "version": "4.64.0",
3
+ "version": "4.66.0",
4
4
  "description": "Shared UI foundation for contract-first, database-backed React apps: shadcn primitives, DataTable/EntityForm composites, auth, the gateway error seam, design tokens, lint rules and the AI playbook.",
5
5
  "license": "MIT",
6
6
  "repository": {