@syntrologie/adapt-content 2.8.0-canary.62 → 2.8.0-canary.621

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 (115) hide show
  1. package/dist/chunk-PZ5AY32C.js +10 -0
  2. package/dist/chunk-PZ5AY32C.js.map +7 -0
  3. package/dist/runtime.d.ts +8 -1
  4. package/dist/runtime.d.ts.map +1 -1
  5. package/dist/runtime.js +503 -348
  6. package/dist/runtime.js.map +7 -0
  7. package/dist/sanitizer.d.ts.map +1 -1
  8. package/dist/schema.d.ts +62 -22
  9. package/dist/schema.d.ts.map +1 -1
  10. package/dist/schema.js +4777 -62
  11. package/dist/schema.js.map +7 -0
  12. package/dist/types.d.ts +12 -0
  13. package/dist/types.d.ts.map +1 -1
  14. package/package.json +2 -23
  15. package/dist/cdn.d.ts +0 -35
  16. package/dist/cdn.d.ts.map +0 -1
  17. package/dist/cdn.js +0 -39
  18. package/dist/components/AnchorPicker.d.ts +0 -8
  19. package/dist/components/AnchorPicker.d.ts.map +0 -1
  20. package/dist/components/AnchorPicker.js +0 -6
  21. package/dist/content-editor-state.d.ts +0 -45
  22. package/dist/content-editor-state.d.ts.map +0 -1
  23. package/dist/content-editor-state.js +0 -123
  24. package/dist/content-editor-ui.d.ts +0 -26
  25. package/dist/content-editor-ui.d.ts.map +0 -1
  26. package/dist/content-editor-ui.js +0 -291
  27. package/dist/editor.d.ts +0 -9
  28. package/dist/editor.d.ts.map +0 -1
  29. package/dist/editor.js +0 -8
  30. package/dist/reconciliation-guard.js +0 -80
  31. package/dist/sanitizer.js +0 -95
  32. package/dist/summarize.js +0 -88
  33. package/dist/types.js +0 -7
  34. package/dist/utils/selectorGenerator.d.ts +0 -6
  35. package/dist/utils/selectorGenerator.d.ts.map +0 -1
  36. package/dist/utils/selectorGenerator.js +0 -4
  37. package/node_modules/@syntrologie/shared-editor-ui/dist/cn.d.ts +0 -2
  38. package/node_modules/@syntrologie/shared-editor-ui/dist/cn.d.ts.map +0 -1
  39. package/node_modules/@syntrologie/shared-editor-ui/dist/cn.js +0 -3
  40. package/node_modules/@syntrologie/shared-editor-ui/dist/components/AnchorPicker.d.ts +0 -34
  41. package/node_modules/@syntrologie/shared-editor-ui/dist/components/AnchorPicker.d.ts.map +0 -1
  42. package/node_modules/@syntrologie/shared-editor-ui/dist/components/AnchorPicker.js +0 -158
  43. package/node_modules/@syntrologie/shared-editor-ui/dist/components/BeforeAfterToggle.d.ts +0 -7
  44. package/node_modules/@syntrologie/shared-editor-ui/dist/components/BeforeAfterToggle.d.ts.map +0 -1
  45. package/node_modules/@syntrologie/shared-editor-ui/dist/components/BeforeAfterToggle.js +0 -9
  46. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ConditionStatusLine.d.ts +0 -23
  47. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ConditionStatusLine.d.ts.map +0 -1
  48. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ConditionStatusLine.js +0 -40
  49. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DetectionBadge.d.ts +0 -7
  50. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DetectionBadge.d.ts.map +0 -1
  51. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DetectionBadge.js +0 -22
  52. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DismissedSection.d.ts +0 -8
  53. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DismissedSection.d.ts.map +0 -1
  54. package/node_modules/@syntrologie/shared-editor-ui/dist/components/DismissedSection.js +0 -9
  55. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditBackButton.d.ts +0 -7
  56. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditBackButton.d.ts.map +0 -1
  57. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditBackButton.js +0 -4
  58. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorBody.d.ts +0 -7
  59. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorBody.d.ts.map +0 -1
  60. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorBody.js +0 -4
  61. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorCard.d.ts +0 -13
  62. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorCard.d.ts.map +0 -1
  63. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorCard.js +0 -15
  64. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorFooter.d.ts +0 -7
  65. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorFooter.d.ts.map +0 -1
  66. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorFooter.js +0 -4
  67. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorHeader.d.ts +0 -9
  68. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorHeader.d.ts.map +0 -1
  69. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorHeader.js +0 -4
  70. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorInput.d.ts +0 -8
  71. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorInput.d.ts.map +0 -1
  72. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorInput.js +0 -8
  73. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorLayout.d.ts +0 -7
  74. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorLayout.d.ts.map +0 -1
  75. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorLayout.js +0 -4
  76. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorPanelShell.d.ts +0 -25
  77. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorPanelShell.d.ts.map +0 -1
  78. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorPanelShell.js +0 -379
  79. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorSelect.d.ts +0 -8
  80. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorSelect.d.ts.map +0 -1
  81. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorSelect.js +0 -8
  82. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorTextarea.d.ts +0 -8
  83. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorTextarea.d.ts.map +0 -1
  84. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorTextarea.js +0 -17
  85. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ElementHighlight.d.ts +0 -32
  86. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ElementHighlight.d.ts.map +0 -1
  87. package/node_modules/@syntrologie/shared-editor-ui/dist/components/ElementHighlight.js +0 -85
  88. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EmptyState.d.ts +0 -6
  89. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EmptyState.d.ts.map +0 -1
  90. package/node_modules/@syntrologie/shared-editor-ui/dist/components/EmptyState.js +0 -4
  91. package/node_modules/@syntrologie/shared-editor-ui/dist/components/GroupHeader.d.ts +0 -8
  92. package/node_modules/@syntrologie/shared-editor-ui/dist/components/GroupHeader.d.ts.map +0 -1
  93. package/node_modules/@syntrologie/shared-editor-ui/dist/components/GroupHeader.js +0 -5
  94. package/node_modules/@syntrologie/shared-editor-ui/dist/components/TriggerJourney.d.ts +0 -12
  95. package/node_modules/@syntrologie/shared-editor-ui/dist/components/TriggerJourney.d.ts.map +0 -1
  96. package/node_modules/@syntrologie/shared-editor-ui/dist/components/TriggerJourney.js +0 -40
  97. package/node_modules/@syntrologie/shared-editor-ui/dist/formatConditionLabel.d.ts +0 -26
  98. package/node_modules/@syntrologie/shared-editor-ui/dist/formatConditionLabel.d.ts.map +0 -1
  99. package/node_modules/@syntrologie/shared-editor-ui/dist/formatConditionLabel.js +0 -202
  100. package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useElementRect.d.ts +0 -8
  101. package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useElementRect.d.ts.map +0 -1
  102. package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useElementRect.js +0 -46
  103. package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useTriggerWhenStatus.d.ts +0 -24
  104. package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useTriggerWhenStatus.d.ts.map +0 -1
  105. package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useTriggerWhenStatus.js +0 -86
  106. package/node_modules/@syntrologie/shared-editor-ui/dist/index.d.ts +0 -34
  107. package/node_modules/@syntrologie/shared-editor-ui/dist/index.d.ts.map +0 -1
  108. package/node_modules/@syntrologie/shared-editor-ui/dist/index.js +0 -25
  109. package/node_modules/@syntrologie/shared-editor-ui/dist/utils/elementChainRecommender.d.ts +0 -37
  110. package/node_modules/@syntrologie/shared-editor-ui/dist/utils/elementChainRecommender.d.ts.map +0 -1
  111. package/node_modules/@syntrologie/shared-editor-ui/dist/utils/elementChainRecommender.js +0 -52
  112. package/node_modules/@syntrologie/shared-editor-ui/dist/utils/selectorGenerator.d.ts +0 -22
  113. package/node_modules/@syntrologie/shared-editor-ui/dist/utils/selectorGenerator.d.ts.map +0 -1
  114. package/node_modules/@syntrologie/shared-editor-ui/dist/utils/selectorGenerator.js +0 -143
  115. package/node_modules/@syntrologie/shared-editor-ui/package.json +0 -47
package/dist/types.d.ts CHANGED
@@ -42,5 +42,17 @@ export interface SetStyleAction extends BaseAction {
42
42
  anchorId: AnchorId;
43
43
  styles: Record<string, string>;
44
44
  }
45
+ /**
46
+ * Stylesheet-rule variant of setStyle — hides/styles every element matching
47
+ * a selector via an injected `<style>` rule, without ever resolving or
48
+ * waiting for a live DOM node. See the doc comment on
49
+ * `HideBySelectorAction` in `@syntrologie/runtime-sdk`'s `actions/types.ts`
50
+ * for the full rationale (BUG-1786758064).
51
+ */
52
+ export interface HideBySelectorAction extends BaseAction {
53
+ kind: 'content:hideBySelector';
54
+ anchorId: AnchorId;
55
+ styles: Record<string, string>;
56
+ }
45
57
  export type { ActionExecutor, ExecutorCleanup, ExecutorContext, ExecutorResult, ExecutorUpdate, } from '@syntrologie/sdk-contracts';
46
58
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,cAAc,EACf,MAAM,4BAA4B,CAAC;AAEpC,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,CAAC;AAMjD,UAAU,UAAU;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAAiB,SAAQ,UAAU;IAClD,IAAI,EAAE,oBAAoB,CAAC;IAC3B,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,cAAc,CAAC;IACzB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,MAAM,WAAW,aAAc,SAAQ,UAAU;IAC/C,IAAI,EAAE,iBAAiB,CAAC;IACxB,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,aAAc,SAAQ,UAAU;IAC/C,IAAI,EAAE,iBAAiB,CAAC;IACxB,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,cAAe,SAAQ,UAAU;IAChD,IAAI,EAAE,kBAAkB,CAAC;IACzB,QAAQ,EAAE,QAAQ,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,iBAAkB,SAAQ,UAAU;IACnD,IAAI,EAAE,qBAAqB,CAAC;IAC5B,QAAQ,EAAE,QAAQ,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,cAAe,SAAQ,UAAU;IAChD,IAAI,EAAE,kBAAkB,CAAC;IACzB,QAAQ,EAAE,QAAQ,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC;AAMD,YAAY,EACV,cAAc,EACd,eAAe,EACf,eAAe,EACf,cAAc,EACd,cAAc,GACf,MAAM,4BAA4B,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EACV,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,cAAc,EACf,MAAM,4BAA4B,CAAC;AAEpC,YAAY,EAAE,gBAAgB,EAAE,cAAc,EAAE,CAAC;AAMjD,UAAU,UAAU;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,gBAAiB,SAAQ,UAAU;IAClD,IAAI,EAAE,oBAAoB,CAAC;IAC3B,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,cAAc,CAAC;IACzB,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,MAAM,WAAW,aAAc,SAAQ,UAAU;IAC/C,IAAI,EAAE,iBAAiB,CAAC;IACxB,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,aAAc,SAAQ,UAAU;IAC/C,IAAI,EAAE,iBAAiB,CAAC;IACxB,QAAQ,EAAE,QAAQ,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,cAAe,SAAQ,UAAU;IAChD,IAAI,EAAE,kBAAkB,CAAC;IACzB,QAAQ,EAAE,QAAQ,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,iBAAkB,SAAQ,UAAU;IACnD,IAAI,EAAE,qBAAqB,CAAC;IAC5B,QAAQ,EAAE,QAAQ,CAAC;IACnB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,cAAe,SAAQ,UAAU;IAChD,IAAI,EAAE,kBAAkB,CAAC;IACzB,QAAQ,EAAE,QAAQ,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC;AAED;;;;;;GAMG;AACH,MAAM,WAAW,oBAAqB,SAAQ,UAAU;IACtD,IAAI,EAAE,wBAAwB,CAAC;IAC/B,QAAQ,EAAE,QAAQ,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAChC;AAMD,YAAY,EACV,cAAc,EACd,eAAe,EACf,eAAe,EACf,cAAc,EACd,cAAc,GACf,MAAM,4BAA4B,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@syntrologie/adapt-content",
3
- "version": "2.8.0-canary.62",
3
+ "version": "2.8.0-canary.621",
4
4
  "description": "Adaptive Content app - DOM manipulation actions for text, attributes, and styles",
5
5
  "license": "Proprietary",
6
6
  "private": false,
@@ -22,47 +22,26 @@
22
22
  "./schema": {
23
23
  "types": "./dist/schema.d.ts",
24
24
  "import": "./dist/schema.js"
25
- },
26
- "./editor": {
27
- "types": "./dist/editor.d.ts",
28
- "import": "./dist/editor.js"
29
25
  }
30
26
  },
31
27
  "files": [
32
28
  "dist"
33
29
  ],
34
- "bundledDependencies": [
35
- "@syntrologie/shared-editor-ui"
36
- ],
37
30
  "scripts": {
38
31
  "prepack": "node ../../../scripts/prepare-bundled-deps.mjs",
39
- "build": "tsc",
32
+ "build": "tsc --emitDeclarationOnly && node ../scripts/build-lib.mjs",
40
33
  "typecheck": "tsc --noEmit",
41
34
  "clean": "rm -rf dist",
42
35
  "test": "vitest run",
43
36
  "test:watch": "vitest"
44
37
  },
45
- "peerDependencies": {
46
- "lucide-react": ">=0.400.0",
47
- "react": ">=18.0.0",
48
- "react-dom": ">=18.0.0",
49
- "zod": "^3.0.0"
50
- },
51
38
  "dependencies": {
52
- "@syntrologie/shared-editor-ui": "*",
53
39
  "css-selector-generator": "3.8.0",
54
40
  "data-urls": "5.0.0"
55
41
  },
56
42
  "devDependencies": {
57
- "@floating-ui/dom": "1.7.5",
58
43
  "@syntrologie/sdk-contracts": "*",
59
- "@testing-library/react": "16.3.2",
60
- "@types/react": "19.2.14",
61
- "@types/react-dom": "19.2.3",
62
44
  "jsdom": "26.1.0",
63
- "lucide-react": "0.576.0",
64
- "react": "19.2.1",
65
- "react-dom": "19.2.1",
66
45
  "typescript": "5.9.3",
67
46
  "vitest": "4.0.18",
68
47
  "zod": "3.25.76"
package/dist/cdn.d.ts DELETED
@@ -1,35 +0,0 @@
1
- /**
2
- * CDN Entry Point for Adaptive Content
3
- *
4
- * This module is bundled for CDN delivery and self-registers with the global
5
- * SynOS app registry when loaded dynamically via the AppLoader.
6
- */
7
- /**
8
- * App manifest for registry registration.
9
- * Follows the AppManifest interface expected by AppLoader/AppRegistry.
10
- */
11
- export declare const manifest: {
12
- id: string;
13
- version: string;
14
- name: string;
15
- description: string;
16
- runtime: {
17
- actions: {
18
- kind: "content:insertHtml" | "content:setText" | "content:setAttr" | "content:addClass" | "content:removeClass" | "content:setStyle";
19
- executor: import("packages/sdk-contracts/dist").ActionExecutor<import("./types").InsertHtmlAction> | import("packages/sdk-contracts/dist").ActionExecutor<import("./types").SetTextAction> | import("packages/sdk-contracts/dist").ActionExecutor<import("./types").SetAttrAction> | import("packages/sdk-contracts/dist").ActionExecutor<import("./types").AddClassAction> | import("packages/sdk-contracts/dist").ActionExecutor<import("./types").RemoveClassAction> | import("packages/sdk-contracts/dist").ActionExecutor<import("./types").SetStyleAction>;
20
- }[];
21
- };
22
- editor: {
23
- panel: {
24
- title: string;
25
- icon: string;
26
- description: string;
27
- };
28
- component: typeof import("./content-editor-ui").ContentEditor;
29
- };
30
- metadata: {
31
- isBuiltIn: boolean;
32
- };
33
- };
34
- export default manifest;
35
- //# sourceMappingURL=cdn.d.ts.map
package/dist/cdn.d.ts.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"cdn.d.ts","sourceRoot":"","sources":["../src/cdn.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH;;;GAGG;AACH,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;CAepB,CAAC;AAaF,eAAe,QAAQ,CAAC"}
package/dist/cdn.js DELETED
@@ -1,39 +0,0 @@
1
- /**
2
- * CDN Entry Point for Adaptive Content
3
- *
4
- * This module is bundled for CDN delivery and self-registers with the global
5
- * SynOS app registry when loaded dynamically via the AppLoader.
6
- */
7
- import { editor } from './editor';
8
- import { executors, runtime } from './runtime';
9
- /**
10
- * App manifest for registry registration.
11
- * Follows the AppManifest interface expected by AppLoader/AppRegistry.
12
- */
13
- export const manifest = {
14
- id: runtime.id,
15
- version: runtime.version,
16
- name: runtime.name,
17
- description: runtime.description,
18
- runtime: {
19
- actions: executors.map(({ kind, executor }) => ({
20
- kind,
21
- executor,
22
- })),
23
- },
24
- editor,
25
- metadata: {
26
- isBuiltIn: true,
27
- },
28
- };
29
- /**
30
- * Self-register with global registry if available.
31
- * This happens when loaded via script tag (UMD).
32
- */
33
- if (typeof window !== 'undefined') {
34
- const registry = window.SynOS?.appRegistry;
35
- if (registry && typeof registry.register === 'function') {
36
- registry.register(manifest);
37
- }
38
- }
39
- export default manifest;
@@ -1,8 +0,0 @@
1
- /**
2
- * Re-export AnchorPicker from shared-editor-ui.
3
- * This file exists for backwards compatibility — all consumers should
4
- * migrate to importing directly from @syntrologie/shared-editor-ui.
5
- */
6
- export type { AnchorPickerProps, PickedElement } from '@syntrologie/shared-editor-ui';
7
- export { AnchorPicker } from '@syntrologie/shared-editor-ui';
8
- //# sourceMappingURL=AnchorPicker.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"AnchorPicker.d.ts","sourceRoot":"","sources":["../../src/components/AnchorPicker.tsx"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACtF,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC"}
@@ -1,6 +0,0 @@
1
- /**
2
- * Re-export AnchorPicker from shared-editor-ui.
3
- * This file exists for backwards compatibility — all consumers should
4
- * migrate to importing directly from @syntrologie/shared-editor-ui.
5
- */
6
- export { AnchorPicker } from '@syntrologie/shared-editor-ui';
@@ -1,45 +0,0 @@
1
- /**
2
- * Adaptive Content - Editor State & Logic
3
- *
4
- * Pure helpers for the content editor: anchor resolution, types, section config,
5
- * flatten/filter logic, anchor detection hook, and dismissal management.
6
- */
7
- import type { ContentConfig } from './schema';
8
- /** Extract the CSS selector string from an anchorId (object or legacy string). */
9
- export declare function resolveAnchorSelector(anchorId: unknown): string;
10
- /** Extract the target route from an AnchorId object, ignoring wildcard '**'. */
11
- export declare function resolveAnchorRoute(anchorId: unknown): string | null;
12
- /** Save a pending highlight selector to sessionStorage (inlined to avoid cross-package import). */
13
- export declare function savePendingHighlight(selector: string): void;
14
- export type SectionKey = keyof ContentConfig;
15
- export interface ItemRef {
16
- section: SectionKey;
17
- index: number;
18
- }
19
- export declare function itemKey(section: SectionKey, index: number): string;
20
- export declare function parseItemKey(key: string): ItemRef;
21
- export declare const SECTION_ICON_MAP: Record<SectionKey, React.ComponentType<{
22
- size?: number;
23
- className?: string;
24
- }>>;
25
- export interface FlatItem {
26
- key: string;
27
- section: SectionKey;
28
- index: number;
29
- summary: string;
30
- anchorId: string;
31
- rawAnchorId: unknown;
32
- }
33
- /** Build a flat list of all items across all section types. */
34
- export declare function flattenItems(config: ContentConfig): FlatItem[];
35
- /** Remove items by key set from a config, returning a new config. */
36
- export declare function filterConfig(config: ContentConfig, dismissedKeys: Set<string>): ContentConfig;
37
- export interface DetectionEntry {
38
- found: boolean;
39
- element: HTMLElement | null;
40
- }
41
- export declare function useAnchorDetection(items: Array<{
42
- key: string;
43
- anchorId: string;
44
- }>): Map<string, DetectionEntry>;
45
- //# sourceMappingURL=content-editor-state.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"content-editor-state.d.ts","sourceRoot":"","sources":["../src/content-editor-state.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAO9C,kFAAkF;AAClF,wBAAgB,qBAAqB,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,CAK/D;AAED,gFAAgF;AAChF,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI,CASnE;AAED,mGAAmG;AACnG,wBAAgB,oBAAoB,CAAC,QAAQ,EAAE,MAAM,QAMpD;AAMD,MAAM,MAAM,UAAU,GAAG,MAAM,aAAa,CAAC;AAE7C,MAAM,WAAW,OAAO;IACtB,OAAO,EAAE,UAAU,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;CACf;AAED,wBAAgB,OAAO,CAAC,OAAO,EAAE,UAAU,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAElE;AAED,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAGjD;AAMD,eAAO,MAAM,gBAAgB,EAAE,MAAM,CACnC,UAAU,EACV,KAAK,CAAC,aAAa,CAAC;IAAE,IAAI,CAAC,EAAE,MAAM,CAAC;IAAC,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAQ3D,CAAC;AAMF,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,UAAU,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,OAAO,CAAC;CACtB;AAED,+DAA+D;AAC/D,wBAAgB,YAAY,CAAC,MAAM,EAAE,aAAa,GAAG,QAAQ,EAAE,CAkB9D;AAED,qEAAqE;AACrE,wBAAgB,YAAY,CAAC,MAAM,EAAE,aAAa,EAAE,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,aAAa,CAW7F;AAMD,MAAM,WAAW,cAAc;IAC7B,KAAK,EAAE,OAAO,CAAC;IACf,OAAO,EAAE,WAAW,GAAG,IAAI,CAAC;CAC7B;AAED,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,KAAK,CAAC;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC,GAC9C,GAAG,CAAC,MAAM,EAAE,cAAc,CAAC,CA6B7B"}
@@ -1,123 +0,0 @@
1
- /**
2
- * Adaptive Content - Editor State & Logic
3
- *
4
- * Pure helpers for the content editor: anchor resolution, types, section config,
5
- * flatten/filter logic, anchor detection hook, and dismissal management.
6
- */
7
- import { FileCode, Minus, Palette, Plus, Tag, Type } from 'lucide-react';
8
- import { useEffect, useRef, useState } from 'react';
9
- import { summarizeContentChange } from './summarize';
10
- // ============================================================================
11
- // Anchor Helpers
12
- // ============================================================================
13
- /** Extract the CSS selector string from an anchorId (object or legacy string). */
14
- export function resolveAnchorSelector(anchorId) {
15
- if (!anchorId)
16
- return '';
17
- if (typeof anchorId === 'string')
18
- return anchorId;
19
- if (typeof anchorId === 'object')
20
- return anchorId.selector ?? '';
21
- return '';
22
- }
23
- /** Extract the target route from an AnchorId object, ignoring wildcard '**'. */
24
- export function resolveAnchorRoute(anchorId) {
25
- if (!anchorId || typeof anchorId !== 'object')
26
- return null;
27
- const route = anchorId.route;
28
- if (typeof route === 'string' && route !== '**')
29
- return route;
30
- if (Array.isArray(route)) {
31
- const first = route.find((r) => typeof r === 'string' && r !== '**');
32
- return first ?? null;
33
- }
34
- return null;
35
- }
36
- /** Save a pending highlight selector to sessionStorage (inlined to avoid cross-package import). */
37
- export function savePendingHighlight(selector) {
38
- try {
39
- sessionStorage.setItem('syntro:editor:pending-highlight', selector);
40
- }
41
- catch {
42
- // Silently ignore
43
- }
44
- }
45
- export function itemKey(section, index) {
46
- return `${section}:${index}`;
47
- }
48
- export function parseItemKey(key) {
49
- const [section, indexStr] = key.split(':');
50
- return { section: section, index: Number(indexStr) };
51
- }
52
- // ============================================================================
53
- // Section Config
54
- // ============================================================================
55
- export const SECTION_ICON_MAP = {
56
- textReplacements: Type,
57
- attributeChanges: Tag,
58
- styleChanges: Palette,
59
- htmlInsertions: FileCode,
60
- classAdditions: Plus,
61
- classRemovals: Minus,
62
- };
63
- /** Build a flat list of all items across all section types. */
64
- export function flattenItems(config) {
65
- const items = [];
66
- const sections = Object.keys(SECTION_ICON_MAP);
67
- for (const section of sections) {
68
- const arr = config[section] || [];
69
- arr.forEach((item, i) => {
70
- const rec = item;
71
- items.push({
72
- key: itemKey(section, i),
73
- section,
74
- index: i,
75
- summary: summarizeContentChange(section, rec),
76
- anchorId: resolveAnchorSelector(rec.anchorId),
77
- rawAnchorId: rec.anchorId,
78
- });
79
- });
80
- }
81
- return items;
82
- }
83
- /** Remove items by key set from a config, returning a new config. */
84
- export function filterConfig(config, dismissedKeys) {
85
- const result = { ...config };
86
- const sections = Object.keys(SECTION_ICON_MAP);
87
- for (const section of sections) {
88
- const arr = config[section] || [];
89
- const filtered = arr.filter((_, i) => !dismissedKeys.has(itemKey(section, i)));
90
- if (filtered.length > 0 || config[section] !== undefined) {
91
- result[section] = filtered;
92
- }
93
- }
94
- return result;
95
- }
96
- export function useAnchorDetection(items) {
97
- const [detectionMap, setDetectionMap] = useState(new Map());
98
- const itemsRef = useRef(items);
99
- itemsRef.current = items;
100
- useEffect(() => {
101
- const runDetection = () => {
102
- const map = new Map();
103
- for (const item of itemsRef.current) {
104
- if (!item.anchorId) {
105
- map.set(item.key, { found: false, element: null });
106
- continue;
107
- }
108
- try {
109
- const el = document.querySelector(item.anchorId);
110
- map.set(item.key, { found: el !== null, element: el });
111
- }
112
- catch {
113
- map.set(item.key, { found: false, element: null });
114
- }
115
- }
116
- setDetectionMap(map);
117
- };
118
- runDetection();
119
- const interval = setInterval(runDetection, 2000);
120
- return () => clearInterval(interval);
121
- }, []);
122
- return detectionMap;
123
- }
@@ -1,26 +0,0 @@
1
- /**
2
- * Adaptive Content - Editor UI Component
3
- *
4
- * Main editor component with tab switching, item selection, form inputs,
5
- * save/publish, and highlight on page.
6
- */
7
- import type { EditorPanelProps } from './types';
8
- export declare function ContentEditor({ config, onChange, editor }: EditorPanelProps): import("react/jsx-runtime").JSX.Element;
9
- /**
10
- * Editor module configuration.
11
- */
12
- export declare const editor: {
13
- panel: {
14
- title: string;
15
- icon: string;
16
- description: string;
17
- };
18
- component: typeof ContentEditor;
19
- };
20
- export declare const editorPanel: {
21
- title: string;
22
- icon: string;
23
- description: string;
24
- };
25
- export default ContentEditor;
26
- //# sourceMappingURL=content-editor-ui.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"content-editor-ui.d.ts","sourceRoot":"","sources":["../src/content-editor-ui.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAgCH,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAgBhD,wBAAgB,aAAa,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,gBAAgB,2CAsjB3E;AAED;;GAEG;AACH,eAAO,MAAM,MAAM;;;;;;;CAOlB,CAAC;AAEF,eAAO,MAAM,WAAW;;;;CAAe,CAAC;AAExC,eAAe,aAAa,CAAC"}