@selfhelp/shared 1.23.0 → 1.25.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 (37) hide show
  1. package/CHANGELOG.md +127 -0
  2. package/dist/index.d.mts +300 -100
  3. package/dist/index.d.ts +300 -100
  4. package/dist/index.js +531 -3
  5. package/dist/index.mjs +506 -3
  6. package/dist/plugin-sdk/index.d.mts +1 -1
  7. package/dist/plugin-sdk/index.d.ts +1 -1
  8. package/dist/plugin-sdk/index.js +7 -1
  9. package/dist/plugin-sdk/index.mjs +7 -1
  10. package/dist/registry/index.d.mts +2 -2
  11. package/dist/registry/index.d.ts +2 -2
  12. package/dist/registry/index.js +15 -1
  13. package/dist/registry/index.mjs +14 -1
  14. package/dist/{styles.registry-BBd9T2Ox.d.ts → styles.registry-C2ACy7H0.d.ts} +734 -2
  15. package/dist/{styles.registry-IjDTff8P.d.mts → styles.registry-DnIJqEzM.d.mts} +734 -2
  16. package/package.json +1 -1
  17. package/src/api/__tests__/endpoints.test.ts +45 -0
  18. package/src/api/__tests__/formListErrors.test.ts +143 -0
  19. package/src/api/endpoints.ts +41 -0
  20. package/src/api/formListErrors.ts +134 -0
  21. package/src/api/index.ts +1 -0
  22. package/src/content/__tests__/formListState.test.ts +448 -0
  23. package/src/content/__tests__/formRecordPrefill.test.ts +120 -0
  24. package/src/content/formListState.ts +559 -0
  25. package/src/content/formRecordPrefill.ts +108 -5
  26. package/src/content/index.ts +1 -0
  27. package/src/registry/__tests__/platform.test.ts +15 -6
  28. package/src/registry/__tests__/registry.test.ts +14 -0
  29. package/src/registry/styles.registry.ts +23 -0
  30. package/src/types/api/__tests__/formWrites.test.ts +84 -0
  31. package/src/types/api/form-lists.ts +475 -0
  32. package/src/types/api/forms.ts +149 -4
  33. package/src/types/api/index.ts +1 -0
  34. package/src/types/styles/__tests__/entryFormListFormFields.test.ts +44 -0
  35. package/src/types/styles/composite.ts +13 -0
  36. package/src/types/styles/forms.ts +124 -0
  37. package/src/types/styles/unknown.ts +5 -1
@@ -239,7 +239,13 @@ var BASE_STYLE_REGISTRY = {
239
239
  version: { description: "Build/version diagnostic surface", category: "auth", canHaveChildren: false },
240
240
  "ref-container": { description: "Renders content referenced from another section", category: "layout", canHaveChildren: true },
241
241
  "data-container": { description: "Data-scoped container (renders subtree against a data scope)", category: "layout", canHaveChildren: true },
242
- "entry-table": { description: "Built-in admin CRUD grid over a form's records (search/sort/paginate/CSV, add / edit / delete actions)", category: "forms", canHaveChildren: false }
242
+ "entry-table": { description: "Built-in admin CRUD grid over a form's records (search/sort/paginate/CSV, add / edit / delete actions)", category: "forms", canHaveChildren: false },
243
+ "entry-form-list": {
244
+ description: "Entry List with Form: a list of records that is also the form that creates and edits them (put the inputs directly inside it); supports search, sort, filters, paging, quick actions and history",
245
+ category: "forms",
246
+ canHaveChildren: true
247
+ },
248
+ "data-view": { description: "Read-only server-rendered table, cards or your own layout (sections placed inside, drawn once per record) of records of a data table", category: "forms", canHaveChildren: true }
243
249
  };
244
250
  var PLUGIN_STYLE_REGISTRY = {};
245
251
  var REGISTERED_PLUGIN_KEYS = /* @__PURE__ */ new Map();
@@ -1,5 +1,5 @@
1
- import { T as TStyleName, I as IStyleRegistryEntry, a as IPluginStyleRegistryEntry, b as TStylePlacement, c as TConcretePlatform, d as TStylePlatform } from '../styles.registry-IjDTff8P.mjs';
2
- export { B as BASE_STYLE_REGISTRY, S as STYLE_REGISTRY, e as TStyleRegistryKey, _ as _AssertRegistryMatchesStyleName, f as _resetPluginStyleRegistry, g as extendStyleRegistry, h as getMergedStyleRegistry, i as getPluginStyleRegistry } from '../styles.registry-IjDTff8P.mjs';
1
+ import { T as TStyleName, I as IStyleRegistryEntry, a as IPluginStyleRegistryEntry, b as TStylePlacement, c as TConcretePlatform, d as TStylePlatform } from '../styles.registry-DnIJqEzM.mjs';
2
+ export { B as BASE_STYLE_REGISTRY, F as FORM_SECTION_STYLE_NAMES, S as STYLE_REGISTRY, e as TFormSectionStyleName, f as TStyleRegistryKey, _ as _AssertRegistryMatchesStyleName, g as _resetPluginStyleRegistry, h as extendStyleRegistry, i as getMergedStyleRegistry, j as getPluginStyleRegistry } from '../styles.registry-DnIJqEzM.mjs';
3
3
  import '../common-qaDIAYS3.mjs';
4
4
 
5
5
  /**
@@ -1,5 +1,5 @@
1
- import { T as TStyleName, I as IStyleRegistryEntry, a as IPluginStyleRegistryEntry, b as TStylePlacement, c as TConcretePlatform, d as TStylePlatform } from '../styles.registry-BBd9T2Ox.js';
2
- export { B as BASE_STYLE_REGISTRY, S as STYLE_REGISTRY, e as TStyleRegistryKey, _ as _AssertRegistryMatchesStyleName, f as _resetPluginStyleRegistry, g as extendStyleRegistry, h as getMergedStyleRegistry, i as getPluginStyleRegistry } from '../styles.registry-BBd9T2Ox.js';
1
+ import { T as TStyleName, I as IStyleRegistryEntry, a as IPluginStyleRegistryEntry, b as TStylePlacement, c as TConcretePlatform, d as TStylePlatform } from '../styles.registry-C2ACy7H0.js';
2
+ export { B as BASE_STYLE_REGISTRY, F as FORM_SECTION_STYLE_NAMES, S as STYLE_REGISTRY, e as TFormSectionStyleName, f as TStyleRegistryKey, _ as _AssertRegistryMatchesStyleName, g as _resetPluginStyleRegistry, h as extendStyleRegistry, i as getMergedStyleRegistry, j as getPluginStyleRegistry } from '../styles.registry-C2ACy7H0.js';
3
3
  import '../common-qaDIAYS3.js';
4
4
 
5
5
  /**
@@ -21,6 +21,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
21
21
  var registry_exports = {};
22
22
  __export(registry_exports, {
23
23
  BASE_STYLE_REGISTRY: () => BASE_STYLE_REGISTRY,
24
+ FORM_SECTION_STYLE_NAMES: () => FORM_SECTION_STYLE_NAMES,
24
25
  STYLE_REGISTRY: () => STYLE_REGISTRY,
25
26
  _resetPluginStyleRegistry: () => _resetPluginStyleRegistry,
26
27
  extendStyleRegistry: () => extendStyleRegistry,
@@ -141,8 +142,20 @@ var BASE_STYLE_REGISTRY = {
141
142
  version: { description: "Build/version diagnostic surface", category: "auth", canHaveChildren: false },
142
143
  "ref-container": { description: "Renders content referenced from another section", category: "layout", canHaveChildren: true },
143
144
  "data-container": { description: "Data-scoped container (renders subtree against a data scope)", category: "layout", canHaveChildren: true },
144
- "entry-table": { description: "Built-in admin CRUD grid over a form's records (search/sort/paginate/CSV, add / edit / delete actions)", category: "forms", canHaveChildren: false }
145
+ "entry-table": { description: "Built-in admin CRUD grid over a form's records (search/sort/paginate/CSV, add / edit / delete actions)", category: "forms", canHaveChildren: false },
146
+ "entry-form-list": {
147
+ description: "Entry List with Form: a list of records that is also the form that creates and edits them (put the inputs directly inside it); supports search, sort, filters, paging, quick actions and history",
148
+ category: "forms",
149
+ canHaveChildren: true
150
+ },
151
+ "data-view": { description: "Read-only server-rendered table, cards or your own layout (sections placed inside, drawn once per record) of records of a data table", category: "forms", canHaveChildren: true }
145
152
  };
153
+ var FORM_SECTION_STYLE_NAMES = [
154
+ "form-record",
155
+ "form-log",
156
+ "entry-record-form",
157
+ "entry-form-list"
158
+ ];
146
159
  var STYLE_REGISTRY = BASE_STYLE_REGISTRY;
147
160
  var PLUGIN_STYLE_REGISTRY = {};
148
161
  var REGISTERED_PLUGIN_KEYS = /* @__PURE__ */ new Map();
@@ -257,6 +270,7 @@ function isStylePlacementAllowed(name, isRoot) {
257
270
  // Annotate the CommonJS export names for ESM import in node:
258
271
  0 && (module.exports = {
259
272
  BASE_STYLE_REGISTRY,
273
+ FORM_SECTION_STYLE_NAMES,
260
274
  STYLE_REGISTRY,
261
275
  _resetPluginStyleRegistry,
262
276
  extendStyleRegistry,
@@ -98,8 +98,20 @@ var BASE_STYLE_REGISTRY = {
98
98
  version: { description: "Build/version diagnostic surface", category: "auth", canHaveChildren: false },
99
99
  "ref-container": { description: "Renders content referenced from another section", category: "layout", canHaveChildren: true },
100
100
  "data-container": { description: "Data-scoped container (renders subtree against a data scope)", category: "layout", canHaveChildren: true },
101
- "entry-table": { description: "Built-in admin CRUD grid over a form's records (search/sort/paginate/CSV, add / edit / delete actions)", category: "forms", canHaveChildren: false }
101
+ "entry-table": { description: "Built-in admin CRUD grid over a form's records (search/sort/paginate/CSV, add / edit / delete actions)", category: "forms", canHaveChildren: false },
102
+ "entry-form-list": {
103
+ description: "Entry List with Form: a list of records that is also the form that creates and edits them (put the inputs directly inside it); supports search, sort, filters, paging, quick actions and history",
104
+ category: "forms",
105
+ canHaveChildren: true
106
+ },
107
+ "data-view": { description: "Read-only server-rendered table, cards or your own layout (sections placed inside, drawn once per record) of records of a data table", category: "forms", canHaveChildren: true }
102
108
  };
109
+ var FORM_SECTION_STYLE_NAMES = [
110
+ "form-record",
111
+ "form-log",
112
+ "entry-record-form",
113
+ "entry-form-list"
114
+ ];
103
115
  var STYLE_REGISTRY = BASE_STYLE_REGISTRY;
104
116
  var PLUGIN_STYLE_REGISTRY = {};
105
117
  var REGISTERED_PLUGIN_KEYS = /* @__PURE__ */ new Map();
@@ -213,6 +225,7 @@ function isStylePlacementAllowed(name, isRoot) {
213
225
  }
214
226
  export {
215
227
  BASE_STYLE_REGISTRY,
228
+ FORM_SECTION_STYLE_NAMES,
216
229
  STYLE_REGISTRY,
217
230
  _resetPluginStyleRegistry,
218
231
  extendStyleRegistry,