@printwithsynergy/artwork-pdf-editor 0.1.6 → 0.3.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 (249) hide show
  1. package/LICENSE +62 -0
  2. package/README.md +63 -2
  3. package/dist/components/AccessibilityHintsPanel.d.ts +142 -0
  4. package/dist/components/AccessibilityHintsPanel.d.ts.map +1 -0
  5. package/dist/components/AccessibilityHintsPanel.js +158 -0
  6. package/dist/components/AccessibilityHintsPanel.js.map +1 -0
  7. package/dist/components/AnnotationOverlay.d.ts +142 -0
  8. package/dist/components/AnnotationOverlay.d.ts.map +1 -0
  9. package/dist/components/AnnotationOverlay.js +141 -0
  10. package/dist/components/AnnotationOverlay.js.map +1 -0
  11. package/dist/components/AnnotationsSidebar.d.ts +98 -0
  12. package/dist/components/AnnotationsSidebar.d.ts.map +1 -0
  13. package/dist/components/AnnotationsSidebar.js +100 -0
  14. package/dist/components/AnnotationsSidebar.js.map +1 -0
  15. package/dist/components/BarcodeGeneratorPanel.d.ts +58 -0
  16. package/dist/components/BarcodeGeneratorPanel.d.ts.map +1 -0
  17. package/dist/components/BarcodeGeneratorPanel.js +91 -0
  18. package/dist/components/BarcodeGeneratorPanel.js.map +1 -0
  19. package/dist/components/BraillePanel.d.ts +99 -0
  20. package/dist/components/BraillePanel.d.ts.map +1 -0
  21. package/dist/components/BraillePanel.js +221 -0
  22. package/dist/components/BraillePanel.js.map +1 -0
  23. package/dist/components/BrandAssetsPanel.d.ts +130 -0
  24. package/dist/components/BrandAssetsPanel.d.ts.map +1 -0
  25. package/dist/components/BrandAssetsPanel.js +125 -0
  26. package/dist/components/BrandAssetsPanel.js.map +1 -0
  27. package/dist/components/BrandConsistencyPanel.d.ts +140 -0
  28. package/dist/components/BrandConsistencyPanel.d.ts.map +1 -0
  29. package/dist/components/BrandConsistencyPanel.js +158 -0
  30. package/dist/components/BrandConsistencyPanel.js.map +1 -0
  31. package/dist/components/ComplianceFindingsPanel.d.ts +62 -0
  32. package/dist/components/ComplianceFindingsPanel.d.ts.map +1 -0
  33. package/dist/components/ComplianceFindingsPanel.js +118 -0
  34. package/dist/components/ComplianceFindingsPanel.js.map +1 -0
  35. package/dist/components/DesignSuggestionsPanel.d.ts +148 -0
  36. package/dist/components/DesignSuggestionsPanel.d.ts.map +1 -0
  37. package/dist/components/DesignSuggestionsPanel.js +154 -0
  38. package/dist/components/DesignSuggestionsPanel.js.map +1 -0
  39. package/dist/components/DielineParametersPanel.d.ts +62 -0
  40. package/dist/components/DielineParametersPanel.d.ts.map +1 -0
  41. package/dist/components/DielineParametersPanel.js +170 -0
  42. package/dist/components/DielineParametersPanel.js.map +1 -0
  43. package/dist/components/DielinePreview.d.ts +150 -0
  44. package/dist/components/DielinePreview.d.ts.map +1 -0
  45. package/dist/components/DielinePreview.js +146 -0
  46. package/dist/components/DielinePreview.js.map +1 -0
  47. package/dist/components/EditorApp.d.ts +39 -5
  48. package/dist/components/EditorApp.d.ts.map +1 -1
  49. package/dist/components/EditorApp.js +110 -5
  50. package/dist/components/EditorApp.js.map +1 -1
  51. package/dist/components/EditorCanvas.d.ts +51 -2
  52. package/dist/components/EditorCanvas.d.ts.map +1 -1
  53. package/dist/components/EditorCanvas.js +117 -48
  54. package/dist/components/EditorCanvas.js.map +1 -1
  55. package/dist/components/EmailNotifyPanel.d.ts +165 -0
  56. package/dist/components/EmailNotifyPanel.d.ts.map +1 -0
  57. package/dist/components/EmailNotifyPanel.js +211 -0
  58. package/dist/components/EmailNotifyPanel.js.map +1 -0
  59. package/dist/components/FileDropZone.d.ts +9 -1
  60. package/dist/components/FileDropZone.d.ts.map +1 -1
  61. package/dist/components/FileDropZone.js +53 -5
  62. package/dist/components/FileDropZone.js.map +1 -1
  63. package/dist/components/FoldEditorPanel.d.ts +68 -0
  64. package/dist/components/FoldEditorPanel.d.ts.map +1 -0
  65. package/dist/components/FoldEditorPanel.js +65 -0
  66. package/dist/components/FoldEditorPanel.js.map +1 -0
  67. package/dist/components/FoldPreviewOverlay.d.ts +48 -0
  68. package/dist/components/FoldPreviewOverlay.d.ts.map +1 -0
  69. package/dist/components/FoldPreviewOverlay.js +182 -0
  70. package/dist/components/FoldPreviewOverlay.js.map +1 -0
  71. package/dist/components/Gs1DigitalLinkPanel.d.ts +103 -0
  72. package/dist/components/Gs1DigitalLinkPanel.d.ts.map +1 -0
  73. package/dist/components/Gs1DigitalLinkPanel.js +199 -0
  74. package/dist/components/Gs1DigitalLinkPanel.js.map +1 -0
  75. package/dist/components/HistoryPanel.d.ts +39 -0
  76. package/dist/components/HistoryPanel.d.ts.map +1 -0
  77. package/dist/components/HistoryPanel.js +72 -0
  78. package/dist/components/HistoryPanel.js.map +1 -0
  79. package/dist/components/IccSoftProofOverlay.d.ts +67 -0
  80. package/dist/components/IccSoftProofOverlay.d.ts.map +1 -0
  81. package/dist/components/IccSoftProofOverlay.js +119 -0
  82. package/dist/components/IccSoftProofOverlay.js.map +1 -0
  83. package/dist/components/ImposePanel.d.ts +71 -0
  84. package/dist/components/ImposePanel.d.ts.map +1 -0
  85. package/dist/components/ImposePanel.js +127 -0
  86. package/dist/components/ImposePanel.js.map +1 -0
  87. package/dist/components/InksPanel.d.ts +61 -0
  88. package/dist/components/InksPanel.d.ts.map +1 -0
  89. package/dist/components/InksPanel.js +84 -0
  90. package/dist/components/InksPanel.js.map +1 -0
  91. package/dist/components/JobSetupPanel.d.ts +118 -0
  92. package/dist/components/JobSetupPanel.d.ts.map +1 -0
  93. package/dist/components/JobSetupPanel.js +169 -0
  94. package/dist/components/JobSetupPanel.js.map +1 -0
  95. package/dist/components/LayersPanel.d.ts.map +1 -1
  96. package/dist/components/LayersPanel.js +1 -0
  97. package/dist/components/LayersPanel.js.map +1 -1
  98. package/dist/components/MarkLibraryPanel.d.ts +131 -0
  99. package/dist/components/MarkLibraryPanel.d.ts.map +1 -0
  100. package/dist/components/MarkLibraryPanel.js +184 -0
  101. package/dist/components/MarkLibraryPanel.js.map +1 -0
  102. package/dist/components/MisEstimateButton.d.ts +73 -0
  103. package/dist/components/MisEstimateButton.d.ts.map +1 -0
  104. package/dist/components/MisEstimateButton.js +57 -0
  105. package/dist/components/MisEstimateButton.js.map +1 -0
  106. package/dist/components/NutritionPanel.d.ts +118 -0
  107. package/dist/components/NutritionPanel.d.ts.map +1 -0
  108. package/dist/components/NutritionPanel.js +169 -0
  109. package/dist/components/NutritionPanel.js.map +1 -0
  110. package/dist/components/PageNavigator.d.ts +26 -0
  111. package/dist/components/PageNavigator.d.ts.map +1 -0
  112. package/dist/components/PageNavigator.js +96 -0
  113. package/dist/components/PageNavigator.js.map +1 -0
  114. package/dist/components/PaletteManager.d.ts +32 -0
  115. package/dist/components/PaletteManager.d.ts.map +1 -0
  116. package/dist/components/PaletteManager.js +89 -0
  117. package/dist/components/PaletteManager.js.map +1 -0
  118. package/dist/components/PaletteToSpotPanel.d.ts +122 -0
  119. package/dist/components/PaletteToSpotPanel.d.ts.map +1 -0
  120. package/dist/components/PaletteToSpotPanel.js +160 -0
  121. package/dist/components/PaletteToSpotPanel.js.map +1 -0
  122. package/dist/components/PreflightAutoFixPanel.d.ts +110 -0
  123. package/dist/components/PreflightAutoFixPanel.d.ts.map +1 -0
  124. package/dist/components/PreflightAutoFixPanel.js +119 -0
  125. package/dist/components/PreflightAutoFixPanel.js.map +1 -0
  126. package/dist/components/PreflightDiffPanel.d.ts +127 -0
  127. package/dist/components/PreflightDiffPanel.d.ts.map +1 -0
  128. package/dist/components/PreflightDiffPanel.js +0 -0
  129. package/dist/components/PreflightDiffPanel.js.map +1 -0
  130. package/dist/components/ProcessRulesPanel.d.ts +81 -0
  131. package/dist/components/ProcessRulesPanel.d.ts.map +1 -0
  132. package/dist/components/ProcessRulesPanel.js +143 -0
  133. package/dist/components/ProcessRulesPanel.js.map +1 -0
  134. package/dist/components/SlackNotifyPanel.d.ts +139 -0
  135. package/dist/components/SlackNotifyPanel.d.ts.map +1 -0
  136. package/dist/components/SlackNotifyPanel.js +133 -0
  137. package/dist/components/SlackNotifyPanel.js.map +1 -0
  138. package/dist/components/SmartSpotMatchPanel.d.ts +143 -0
  139. package/dist/components/SmartSpotMatchPanel.d.ts.map +1 -0
  140. package/dist/components/SmartSpotMatchPanel.js +159 -0
  141. package/dist/components/SmartSpotMatchPanel.js.map +1 -0
  142. package/dist/components/SwatchesPicker.d.ts +83 -0
  143. package/dist/components/SwatchesPicker.d.ts.map +1 -0
  144. package/dist/components/SwatchesPicker.js +151 -0
  145. package/dist/components/SwatchesPicker.js.map +1 -0
  146. package/dist/components/TacOverlay.d.ts +47 -0
  147. package/dist/components/TacOverlay.d.ts.map +1 -0
  148. package/dist/components/TacOverlay.js +116 -0
  149. package/dist/components/TacOverlay.js.map +1 -0
  150. package/dist/components/TrapEditorPanel.d.ts +52 -0
  151. package/dist/components/TrapEditorPanel.d.ts.map +1 -0
  152. package/dist/components/TrapEditorPanel.js +64 -0
  153. package/dist/components/TrapEditorPanel.js.map +1 -0
  154. package/dist/components/TrapPreviewOverlay.d.ts +64 -0
  155. package/dist/components/TrapPreviewOverlay.d.ts.map +1 -0
  156. package/dist/components/TrapPreviewOverlay.js +120 -0
  157. package/dist/components/TrapPreviewOverlay.js.map +1 -0
  158. package/dist/components/VariantMatrixPanel.d.ts +61 -0
  159. package/dist/components/VariantMatrixPanel.d.ts.map +1 -0
  160. package/dist/components/VariantMatrixPanel.js +97 -0
  161. package/dist/components/VariantMatrixPanel.js.map +1 -0
  162. package/dist/components/VariantMatrixVersionPanel.d.ts +122 -0
  163. package/dist/components/VariantMatrixVersionPanel.d.ts.map +1 -0
  164. package/dist/components/VariantMatrixVersionPanel.js +162 -0
  165. package/dist/components/VariantMatrixVersionPanel.js.map +1 -0
  166. package/dist/components/WebhookNotifyPanel.d.ts +160 -0
  167. package/dist/components/WebhookNotifyPanel.d.ts.map +1 -0
  168. package/dist/components/WebhookNotifyPanel.js +100 -0
  169. package/dist/components/WebhookNotifyPanel.js.map +1 -0
  170. package/dist/components/WhiteUnderbasePanel.d.ts +107 -0
  171. package/dist/components/WhiteUnderbasePanel.d.ts.map +1 -0
  172. package/dist/components/WhiteUnderbasePanel.js +104 -0
  173. package/dist/components/WhiteUnderbasePanel.js.map +1 -0
  174. package/dist/data/dielines.json +35 -0
  175. package/dist/hooks/useEditorMode.d.ts +25 -5
  176. package/dist/hooks/useEditorMode.d.ts.map +1 -1
  177. package/dist/hooks/useEditorMode.js +18 -5
  178. package/dist/hooks/useEditorMode.js.map +1 -1
  179. package/dist/index.d.ts +49 -2
  180. package/dist/index.d.ts.map +1 -1
  181. package/dist/index.js +49 -2
  182. package/dist/index.js.map +1 -1
  183. package/dist/lens/dieline-overlay.d.ts +25 -0
  184. package/dist/lens/dieline-overlay.d.ts.map +1 -0
  185. package/dist/lens/dieline-overlay.js +50 -0
  186. package/dist/lens/dieline-overlay.js.map +1 -0
  187. package/dist/lens/index.d.ts +27 -0
  188. package/dist/lens/index.d.ts.map +1 -0
  189. package/dist/lens/index.js +28 -0
  190. package/dist/lens/index.js.map +1 -0
  191. package/dist/lens/preflight-findings.d.ts +21 -0
  192. package/dist/lens/preflight-findings.d.ts.map +1 -0
  193. package/dist/lens/preflight-findings.js +82 -0
  194. package/dist/lens/preflight-findings.js.map +1 -0
  195. package/dist/lib/barcode-scan.d.ts +154 -0
  196. package/dist/lib/barcode-scan.d.ts.map +1 -0
  197. package/dist/lib/barcode-scan.js +152 -0
  198. package/dist/lib/barcode-scan.js.map +1 -0
  199. package/dist/lib/color-math.d.ts +76 -0
  200. package/dist/lib/color-math.d.ts.map +1 -0
  201. package/dist/lib/color-math.js +96 -0
  202. package/dist/lib/color-math.js.map +1 -0
  203. package/dist/lib/dieline-template.d.ts +169 -0
  204. package/dist/lib/dieline-template.d.ts.map +1 -1
  205. package/dist/lib/dieline-template.js +229 -1
  206. package/dist/lib/dieline-template.js.map +1 -1
  207. package/dist/lib/editor-config.d.ts +384 -1
  208. package/dist/lib/editor-config.d.ts.map +1 -1
  209. package/dist/lib/editor-config.js +89 -2
  210. package/dist/lib/editor-config.js.map +1 -1
  211. package/dist/lib/fold-geometry.d.ts +144 -0
  212. package/dist/lib/fold-geometry.d.ts.map +1 -0
  213. package/dist/lib/fold-geometry.js +138 -0
  214. package/dist/lib/fold-geometry.js.map +1 -0
  215. package/dist/lib/merge-tokens.d.ts +81 -0
  216. package/dist/lib/merge-tokens.d.ts.map +1 -0
  217. package/dist/lib/merge-tokens.js +88 -0
  218. package/dist/lib/merge-tokens.js.map +1 -0
  219. package/dist/lib/palette-registry.d.ts +40 -0
  220. package/dist/lib/palette-registry.d.ts.map +1 -0
  221. package/dist/lib/palette-registry.js +49 -0
  222. package/dist/lib/palette-registry.js.map +1 -0
  223. package/dist/lib/panel-anchor.d.ts +101 -0
  224. package/dist/lib/panel-anchor.d.ts.map +1 -0
  225. package/dist/lib/panel-anchor.js +68 -0
  226. package/dist/lib/panel-anchor.js.map +1 -0
  227. package/dist/lib/preflight/checks.d.ts.map +1 -1
  228. package/dist/lib/preflight/checks.js +71 -0
  229. package/dist/lib/preflight/checks.js.map +1 -1
  230. package/dist/lib/preflight/types.d.ts.map +1 -1
  231. package/dist/lib/preflight/types.js +11 -0
  232. package/dist/lib/preflight/types.js.map +1 -1
  233. package/dist/lib/rasterize.d.ts +93 -0
  234. package/dist/lib/rasterize.d.ts.map +1 -0
  235. package/dist/lib/rasterize.js +117 -0
  236. package/dist/lib/rasterize.js.map +1 -0
  237. package/dist/lib/separations-registry.d.ts +99 -0
  238. package/dist/lib/separations-registry.d.ts.map +1 -0
  239. package/dist/lib/separations-registry.js +59 -0
  240. package/dist/lib/separations-registry.js.map +1 -0
  241. package/dist/lib/unwired.d.ts +29 -0
  242. package/dist/lib/unwired.d.ts.map +1 -0
  243. package/dist/lib/unwired.js +58 -0
  244. package/dist/lib/unwired.js.map +1 -0
  245. package/package.json +29 -11
  246. package/dist/components/SeparationsPanel.d.ts +0 -9
  247. package/dist/components/SeparationsPanel.d.ts.map +0 -1
  248. package/dist/components/SeparationsPanel.js +0 -168
  249. package/dist/components/SeparationsPanel.js.map +0 -1
@@ -1,3 +1,37 @@
1
+ /**
2
+ * The palettes the editor can host. Each id maps to a registered
3
+ * panel via {@link import("./palette-registry").PALETTE_REGISTRY}.
4
+ * Visibility is controlled by `EditorConfig.panelVisibility` (an
5
+ * absent / `true` entry means "show"); the `PaletteManager`
6
+ * component renders an overflow toggle on desktop, and
7
+ * `MobileToolDrawer` renders the same toggles in a "Panels" section.
8
+ *
9
+ * `layers` and `preflight` are wired today. The remaining ids are
10
+ * registered for forward compatibility — Wave 1+ components will
11
+ * mount them.
12
+ *
13
+ * @public
14
+ */
15
+ export type PaletteId = "layers" | "preflight" | "dieline-library" | "dieline-parameters" | "dieline-preview" | "swatches" | "inks" | "graphic-styles" | "history" | "fold-preview" | "variant-matrix" | "process-rules" | "preflight-diff" | "brand-assets" | "mark-library" | "slack-notify" | "preflight-autofix" | "smart-spot-match" | "design-suggestions" | "annotations-sidebar" | "brand-consistency" | "webhook-notify" | "email-notify" | "accessibility-hints" | "palette-to-spot" | "white-underbase";
16
+ /**
17
+ * Helper type — only the boolean `enable_*` keys of {@link EditorConfig}
18
+ * (the optional gating-layer keys are filtered out).
19
+ */
20
+ type EnableKey = Extract<keyof EditorConfig, `enable_${string}`>;
21
+ /**
22
+ * Derived feature-key alphabet — every `enable_<feature>` flag becomes
23
+ * a `<feature>` key. Used as the *intended* shape for
24
+ * {@link EditorConfig}'s `capabilities` / `plan_gates` keys and as the
25
+ * parameter type for {@link showFeature}'s lookup.
26
+ *
27
+ * The maps below are typed `Record<string, boolean>` to break the
28
+ * circular type dependency (the keys-of-EditorConfig derivation
29
+ * referencing EditorConfig itself); hosts should still pass
30
+ * `FeatureKey`-shaped strings for compile-time-via-the-helper safety.
31
+ *
32
+ * @public
33
+ */
34
+ export type FeatureKey = EnableKey extends `enable_${infer F}` ? F : never;
1
35
  /**
2
36
  * Programmer-facing feature-flag layer for the editor. Modeled on
3
37
  * `lens-pdf`'s `ViewerConfig`: every host-visible feature is a typed
@@ -10,6 +44,10 @@
10
44
  * the `mode` argument)
11
45
  * 3. Per-instance overrides passed by the host
12
46
  *
47
+ * The `panelVisibility`, `capabilities`, and `plan_gates` layers are
48
+ * optional — absent entries preserve identity behaviour, so existing
49
+ * consumers don't have to set them.
50
+ *
13
51
  * @public
14
52
  */
15
53
  export interface EditorConfig {
@@ -32,10 +70,321 @@ export interface EditorConfig {
32
70
  enable_dieline_chooser: boolean;
33
71
  enable_bleed_input: boolean;
34
72
  enable_layers_panel: boolean;
35
- enable_separations_panel: boolean;
36
73
  enable_preflight_banner: boolean;
74
+ /** F0 — host-toggleable palette overflow menu (desktop) + mobile
75
+ * drawer "Panels" section. When false, all palettes render
76
+ * regardless of their per-id `panelVisibility` entry. */
77
+ enable_palettes: boolean;
78
+ /** F1 plumb — separation-aware UI surface. UI ships in Wave 1+;
79
+ * flag prepares the surface so hosts can opt out preemptively. */
80
+ enable_separations: boolean;
81
+ /** S1 — parametric dieline parameter panel. When enabled, hosts can
82
+ * surface a width/height/depth/bleed editor on top of a parametric
83
+ * dieline template (CF2 or codex-pdf carton macro); the panel
84
+ * emits new parameters via `onChange` and the host wires the
85
+ * regen step. Disable for hosts that only ship the bundled
86
+ * static library. */
87
+ enable_dieline_parameters: boolean;
88
+ /** S6 — lightweight 2D dieline preview panel. When enabled, hosts
89
+ * can mount the {@link DielinePreview} thumbnail next to the
90
+ * parametric editor so a width/height edit and the resulting
91
+ * folded-layout preview update side by side. Distinct from
92
+ * `enable_3d_fold_preview` (which spins up Three.js); this is the
93
+ * cheap always-on chrome companion. */
94
+ enable_dieline_preview: boolean;
95
+ /** C1 — inks palette. Surfaces the live ink list extracted from the
96
+ * most recently rendered PDF, alongside the existing swatches
97
+ * palette (which still handles PANTONE search). Hosts can disable
98
+ * to avoid the `/v1/separations/list` round-trip on every export. */
99
+ enable_inks_panel: boolean;
100
+ /** C3 — swatches palette / browseable PANTONE library picker. When
101
+ * enabled, hosts mount {@link SwatchesPicker} on the right rail;
102
+ * the panel hosts a debounced search input against compile-pdf's
103
+ * `/v1/spots/search` endpoint with an optional library-filter
104
+ * dropdown. Pairs with AI4's `registerSpot` to commit a chosen
105
+ * swatch as a document spot. Hosts that don't run compile-pdf's
106
+ * spots router opt out via this flag. */
107
+ enable_swatches: boolean;
108
+ /** C2 — white / underbase auto-generation panel. When enabled,
109
+ * hosts mount {@link WhiteUnderbasePanel} to compute the union of
110
+ * CMYK fill coverage on the active page and ask compile-pdf's
111
+ * `white_underbase` producer to emit a new opaque-white
112
+ * separation matching that union (optionally choked inward).
113
+ * Hosts that don't run the white-underbase producer opt out via
114
+ * this flag. */
115
+ enable_white_underbase: boolean;
116
+ /** S3 — panel-anchored objects. When enabled, hosts can bind
117
+ * artwork objects to a specific {@link DielinePanel} via
118
+ * `anchorPanelId`; objects re-position with their parent panel
119
+ * when the dieline is folded or regenerated. The flag controls
120
+ * whether the editor surfaces the "Anchor to panel" affordance —
121
+ * the wire model already carries `anchorPanelId` regardless. */
122
+ enable_panel_anchored_objects: boolean;
123
+ /** P3 — compliance findings panel. Surfaces substrate / market /
124
+ * regulation findings from lint-pdf's `P3_compliance_v1` profile
125
+ * separately from the existing generic preflight panel. Hosts
126
+ * that don't run lint-pdf opt out via this flag. */
127
+ enable_compliance_panel: boolean;
128
+ /** P2 — process-specific preflight panel. Surfaces process-physics
129
+ * findings (flexo white-knock, gravure max line freq, screen
130
+ * halftone limit) separately from generic preflight and from the
131
+ * P3 compliance panel. Hosts that don't run lint-pdf's
132
+ * process-aware profile opt out via this flag. */
133
+ enable_process_rules_panel: boolean;
134
+ /** P4 — preflight-diff panel. Compares current preflight findings
135
+ * against a previous {@link import("@artworkpdf/document-model").PreflightSnapshot}
136
+ * from `DocumentV3.preflightHistory` and surfaces what changed
137
+ * (cleared / still firing / new since baseline). Hosts that don't
138
+ * carry preflight history opt out via this flag. */
139
+ enable_preflight_diff: boolean;
140
+ /** B1 — brand-assets registry panel. Surfaces
141
+ * `DocumentV3.brandAssets` as a browsable list grouped by kind
142
+ * (logo, swatch, typography, graphic-style, other). Pairs with
143
+ * the Wave 4 B2 brand-consistency rule (lint-pdf side) — the rule
144
+ * consults the same registry. Hosts that don't carry brand assets
145
+ * opt out via this flag. */
146
+ enable_brand_assets_panel: boolean;
147
+ /** X2 — history scrubber panel. When enabled, hosts mount the
148
+ * {@link HistoryPanel} on the right rail; the panel renders the
149
+ * per-page snapshot stack from {@link EditorCanvas} as a clickable
150
+ * list so users can revert to any prior commit. The panel + palette
151
+ * id were registered in earlier waves; this flag formally gates the
152
+ * surface. */
153
+ enable_history: boolean;
154
+ /** S2 — dieline import (CF2 / DDES / ARD file-drop). When enabled,
155
+ * {@link FileDropZone} accepts the three legacy packaging-industry
156
+ * formats and routes them through `@artworkpdf/dieline-parser` →
157
+ * {@link dielineToPage}, bypassing the PDF preflight phase and
158
+ * seeding the canvas directly. Disable for hosts that only ship
159
+ * PDF artwork (the dropzone falls back to PDF-only). */
160
+ enable_dieline_import: boolean;
161
+ /** X3 — annotation overlay. When enabled, hosts mount the
162
+ * {@link AnnotationOverlay} SVG layer over the canvas to surface
163
+ * `PageV3.annotations` (point / area / text). The overlay is
164
+ * read-only; mutation (add / resolve / delete) is a host concern.
165
+ * Disable for view-only / print-preview surfaces where comments
166
+ * shouldn't appear. */
167
+ enable_annotation_overlay: boolean;
168
+ /** V3 — versioned variant matrix diff viewer. When enabled, hosts
169
+ * can mount the {@link VariantMatrixVersionPanel} to compare two
170
+ * matrix snapshots from their persisted version history. Pairs
171
+ * with the optional `version` field on `VariantMatrix` (Wave 4
172
+ * PR-A). Disable for hosts that don't ship versioned variants. */
173
+ enable_variant_matrix_versions: boolean;
174
+ /** M1 — mark library picker panel. When enabled, hosts mount the
175
+ * {@link MarkLibraryPanel} to browse a host-provided catalogue of
176
+ * printer marks (crop, registration, color bar, slug, other) and
177
+ * wire the selected entry into the active page's marks template.
178
+ * Pairs with compile-pdf's marks producer; disable when no
179
+ * catalogue source is wired. */
180
+ enable_mark_library: boolean;
181
+ /** I3 — Slack-notify panel. When enabled, hosts mount the
182
+ * {@link SlackNotifyPanel} so users can emit a Slack notification
183
+ * keyed to a typed editor event (preflight cleared, job submitted,
184
+ * approval requested, …). Pairs with the synergy `slack.notify`
185
+ * workflow node when one is deployed; disable when no Slack
186
+ * bridge is wired. */
187
+ enable_slack_notify: boolean;
188
+ /** AI3 — Preflight auto-fix suggestions panel. When enabled, hosts
189
+ * mount the {@link PreflightAutoFixPanel} alongside the preflight
190
+ * panel; an AI / rules-engine loader resolves each finding to a
191
+ * list of remediation suggestions the user can apply. Pairs with
192
+ * the synergy `preflight.fix` workflow node when one is deployed;
193
+ * disable when no fix-suggestion adapter is wired. */
194
+ enable_preflight_autofix: boolean;
195
+ /** AI2 — Smart spot-match panel. When enabled, hosts mount the
196
+ * {@link SmartSpotMatchPanel} so users can resolve a picked CMYK
197
+ * / Lab / hex color to ranked nearest-PANTONE candidates with ΔE
198
+ * chips. Pairs with compile-pdf's `/v1/spots/match` endpoint or a
199
+ * tenant-local ΔE engine; disable when no matcher is wired. */
200
+ enable_smart_spot_match: boolean;
201
+ /** AI1 — AI design-suggestions panel. When enabled, hosts mount
202
+ * the {@link DesignSuggestionsPanel} alongside the canvas; a host
203
+ * loader resolves a stream of proactive design hints (typography,
204
+ * color, contrast, layout, imagery) the user can apply or
205
+ * dismiss. Pairs with the synergy `design.suggest` node when one
206
+ * is deployed; disable when no suggestion adapter is wired. */
207
+ enable_design_suggestions: boolean;
208
+ /** X1 — Annotations sidebar. Companion list view to the X3
209
+ * {@link AnnotationOverlay}; surfaces the same annotation stream
210
+ * as a scrollable, filterable list so reviewers can read the
211
+ * thread without hunting for pins. Disable when the host doesn't
212
+ * ship annotations (view-only surfaces, print-preview, …). */
213
+ enable_annotations_sidebar: boolean;
214
+ /** B2 — Brand-consistency findings panel. Companion to the B1
215
+ * brand-assets panel; surfaces a host-loader-supplied list of
216
+ * violations against the brand-asset registry (logo placed too
217
+ * small, fill color outside the swatches set, typography pairing
218
+ * off the brand kit, etc.). Pairs with lint-pdf's brand-consistency
219
+ * profile when one is deployed; disable when no brand-consistency
220
+ * loader is wired. */
221
+ enable_brand_consistency: boolean;
222
+ /** I1 — Generic webhook-notify panel. Companion to the I3
223
+ * {@link SlackNotifyPanel}; emits a structured
224
+ * {@link WebhookNotificationEvent} through a host adapter so any
225
+ * outbound HTTP integration (Zapier, n8n, GitHub Actions
226
+ * `repository_dispatch`, internal worker queues, custom tenant
227
+ * endpoints) can subscribe to editor events without their own
228
+ * panel. Pairs with the synergy `webhook.notify` workflow node when
229
+ * one is deployed; disable when no webhook adapter is wired. */
230
+ enable_webhook_notify: boolean;
231
+ /** I2 — Email-notify panel. Third member of the Wave 4 integration
232
+ * family (alongside I3 Slack and I1 webhook); emits a composed
233
+ * subject + body through a host-supplied {@link EmailNotifyFn}
234
+ * (SMTP relay, SendGrid, Postmark, AWS SES, internal Synergy node,
235
+ * etc.). Pairs with the synergy `email.notify` workflow node when
236
+ * one is deployed; disable when no email transport is wired. */
237
+ enable_email_notify: boolean;
238
+ /** AI4 — Palette → spot conversion panel. Closes the Wave 1 AI
239
+ * family. AI2 {@link SmartSpotMatchPanel} matches a user-picked
240
+ * color to PANTONE; AI4 takes the inverse direction — given the
241
+ * document's existing palette (every distinct fill/stroke on the
242
+ * active page), route each entry through the same matcher and let
243
+ * the user commit the best match into the spot registry in one
244
+ * click. Reuses AI2's {@link SpotMatchLoaderFn} so one host
245
+ * adapter serves both panels. Disable when no matcher is wired. */
246
+ enable_palette_to_spot: boolean;
247
+ /** AI5 — Accessibility hints panel. Fifth member of the AI family
248
+ * (alongside AI1 design-suggestions, AI2 smart spot-match, AI3
249
+ * preflight auto-fix, AI4 palette-to-spot); surfaces a host-loader
250
+ * -supplied list of accessibility findings (low contrast, missing
251
+ * alt text, text-size
252
+ * minimums, color-only signalling). Pairs with a tenant-deployed
253
+ * lint-pdf accessibility profile or an in-house rules engine;
254
+ * disable when no accessibility loader is wired. */
255
+ enable_accessibility_hints: boolean;
256
+ /** F2 — Print-context modal (process, substrate, ICC, TAC, target
257
+ * markets). When false, hosts get a `printContext`-less wire model. */
258
+ enable_print_context: boolean;
37
259
  enable_canvas_grid: boolean;
38
260
  enable_bleed_visualization: boolean;
261
+ /** C4 — debounced rasterize-and-sample on every commit, surfaces a
262
+ * red heatmap over pixels above the TAC threshold plus a chip with
263
+ * `max / avg`. Hosts can disable on low-end devices where the
264
+ * ~250 ms rasterize is too costly. */
265
+ enable_total_ink_coverage_live: boolean;
266
+ /** D1 — background trap-preview overlay. When enabled, the editor
267
+ * posts trap policies to compile-pdf's `/v1/trap/preview` endpoint
268
+ * and renders the predicted trap regions on top of the canvas.
269
+ * Hosts can disable to avoid network chatter on every edit. */
270
+ enable_trap_preview: boolean;
271
+ /** D2 — interactive trap policy editor (modal panel). When
272
+ * enabled, the editor surfaces width / mode controls that write
273
+ * into the active page's `trapConfig`. Per-edge and per-color-pair
274
+ * overrides will follow when the compile-pdf trap producer
275
+ * exposes them. */
276
+ enable_trap_editor: boolean;
277
+ /** O1 — sheet-imposition builder (modal panel). When enabled, the
278
+ * editor surfaces sheet size, rows × cols, gutter / margin in mm,
279
+ * and registration / crop-mark toggles that flow into the
280
+ * compile-pdf impose producer at submission. */
281
+ enable_impose: boolean;
282
+ /** S4 — 3D fold preview overlay. When enabled and the active page
283
+ * carries `panelMetadata`, the editor mounts a Three.js scene
284
+ * showing the dieline's panels in 3D with hinge lines along each
285
+ * fold edge. Hosts on bandwidth-constrained networks can opt out;
286
+ * the Three.js code path stays cold when the flag is `false`. */
287
+ enable_3d_fold_preview: boolean;
288
+ /** S4 (PR-4) — interactive fold editor panel. When enabled,
289
+ * hosts surface an angle slider per fold edge that writes into
290
+ * `document.pages[i].foldConfig`. The {@link FoldPreviewOverlay}
291
+ * re-renders the 3D scene on every commit. Pairs with
292
+ * `enable_3d_fold_preview` — hosts that only want the read-only
293
+ * overlay (no editing) leave this `false`. */
294
+ enable_fold_editor: boolean;
295
+ /** O2 — "Send to MIS" emit. When enabled, hosts surface a button
296
+ * that gathers the document's print-relevant metadata into a
297
+ * manifest and POSTs it to the synergy `mis.estimate` workflow
298
+ * node. Hosts that don't run a MIS bridge opt out via this flag. */
299
+ enable_mis_estimate: boolean;
300
+ /** P1 — process-aware preflight. Gating is at the *call site* —
301
+ * hosts check this flag before mounting the substrate-class
302
+ * dropdown and before forwarding the helper output to lint-pdf's
303
+ * `/v1/preflight/process`. `preflightContextOf` itself is
304
+ * unconditional (a pure projection), so the flag controls the UI
305
+ * surface and the host's outbound wiring, not the helper. */
306
+ enable_process_preflight: boolean;
307
+ /** C5 — ICC soft-proof overlay. When enabled, hosts can mount the
308
+ * {@link IccSoftProofOverlay} on top of the canvas; the overlay's
309
+ * loader adapter resolves to a per-pixel delta-E map (typically
310
+ * via compile-pdf's `/v1/soft-proof/apply`). Disable to skip the
311
+ * rasterize + round-trip cost on devices where the overlay would
312
+ * be too expensive. */
313
+ enable_soft_proof: boolean;
314
+ /** V2 — variant matrix UI for variable-data overrides. When
315
+ * enabled, the editor surfaces a rows-times-columns table of
316
+ * variants and token keys that writes into `document.variants`.
317
+ * The actual merge pipeline (one rendered page-instance per
318
+ * variant) lands in Wave 3 V1; this flag just gates the editing
319
+ * surface. */
320
+ enable_variant_matrix: boolean;
321
+ /** G2g — barcode generator panel. When enabled, hosts can mount the
322
+ * {@link BarcodeGeneratorPanel} on the canvas chrome; the panel's
323
+ * renderer adapter resolves a format + payload to an ImageData
324
+ * bitmap the host then places as a `CanvasObj`. Disable when the
325
+ * host doesn't ship a barcode-rendering backend (no library wired,
326
+ * no compile-pdf endpoint reachable) — surfacing the panel without
327
+ * a working adapter would only frustrate users. */
328
+ enable_barcode_generate: boolean;
329
+ /** G2v — barcode validation preflight rule. When enabled, the
330
+ * client-side `barcode_validation` preflight rule rasterizes the
331
+ * active page, runs {@link scanBarcodes} over the resulting
332
+ * ImageData, then validates each detection via
333
+ * {@link validateBarcode} (EAN-13 check digit, UPC-A length,
334
+ * GS1-128 AI sequence). Detected codes that fail their format's
335
+ * validator surface as warn-severity findings. Disable when the
336
+ * host doesn't ship barcode-bearing artwork (skips the
337
+ * rasterize+scan round-trip on every preflight pass). */
338
+ enable_barcode_validation: boolean;
339
+ /** P5 — Braille layout panel (EN 15823 / Marburg Medium). When
340
+ * enabled, hosts can mount the {@link BraillePanel} to compose
341
+ * Grade 1 English Braille cells. Disable for hosts that don't
342
+ * ship pharma-grade packaging or already wire a tenant-owned
343
+ * Braille translator. */
344
+ enable_braille_panel: boolean;
345
+ /** V1 — variable-data merge helpers. When enabled, hosts can wire
346
+ * `{{token}}` placeholders into Wave 2 V2's variant matrix and use
347
+ * {@link mergeRow} / {@link mergeAllRows} to preview each rendered
348
+ * variant before submitting to compose. Disable for hosts that
349
+ * don't ship variable-data printing. */
350
+ enable_variable_data_merge: boolean;
351
+ /** G3 — GS1 Digital Link composer panel. When enabled, hosts can
352
+ * mount the {@link Gs1DigitalLinkPanel} to assemble a GTIN + AIs
353
+ * into a canonical GS1 Digital Link URL (optionally rendered as a
354
+ * QR via the same renderer adapter the G2g panel uses). Disable
355
+ * when the host's workflow doesn't ship GS1-encoded artwork. */
356
+ enable_gs1_digital_link: boolean;
357
+ /** G1 — FDA Nutrition Facts label data-entry panel. When enabled,
358
+ * hosts can mount the {@link NutritionPanel} to compose a typed
359
+ * {@link NutritionFacts} record into an ordered
360
+ * {@link NutritionPanelSpec} the host renders onto the canvas.
361
+ * Disable for hosts that don't deal with food / supplement
362
+ * labelling. */
363
+ enable_nutrition_panel: boolean;
364
+ /**
365
+ * Per-palette visibility. Absent or `true` means visible; `false`
366
+ * hides without removing the toggle from the {@link PaletteId}
367
+ * registry. Hosts that want sticky visibility persist this object
368
+ * keyed by user + document.
369
+ */
370
+ panelVisibility?: Partial<Record<PaletteId, boolean>>;
371
+ /**
372
+ * Runtime capability declarations from the backend (e.g. "this
373
+ * tenant's compile-pdf instance has /v1/impose/apply enabled").
374
+ * Absent entry defaults to `true`. `false` hides the feature.
375
+ * Separate from `plan_gates` so the UI can distinguish "capability
376
+ * absent" from "plan doesn't include this".
377
+ *
378
+ * Keys are {@link FeatureKey}-shaped (typed `string` to break a
379
+ * circular dep — hosts should pass `FeatureKey` values).
380
+ */
381
+ capabilities?: Record<string, boolean>;
382
+ /**
383
+ * Plan-tier gating (e.g. "spot library is paid"). Same shape as
384
+ * `capabilities` but conceptually orthogonal — a feature can be
385
+ * capable + plan-gated, in which case both must be true.
386
+ */
387
+ plan_gates?: Record<string, boolean>;
39
388
  }
40
389
  /**
41
390
  * Default flag set — every feature on. Hosts that want a minimal
@@ -66,4 +415,38 @@ export declare const PRO_MODE_OVERRIDES: Partial<EditorConfig>;
66
415
  * @public
67
416
  */
68
417
  export declare function resolveConfig(mode: "basic" | "pro", instanceOverrides?: Partial<EditorConfig>): EditorConfig;
418
+ /**
419
+ * Resolve whether a feature should be visible right now.
420
+ *
421
+ * Evaluates four gates and returns true iff *all* are open:
422
+ * 1. `enable_<f>` is not explicitly `false`.
423
+ * 2. `plan_gates[f]` is not explicitly `false` (absent = open).
424
+ * 3. `capabilities[f]` is not explicitly `false` (absent = open).
425
+ * 4. `f` hasn't been marked unwired via
426
+ * {@link import("./unwired").markUnwired}.
427
+ *
428
+ * Use this at every render site that gates a feature; the four-layer
429
+ * separation lets hosts distinguish "we hid it" from "the plan
430
+ * doesn't include it" from "the backend can't do it right now" from
431
+ * "the editor build doesn't ship this UI yet" without losing the
432
+ * underlying boolean flag.
433
+ *
434
+ * @public
435
+ */
436
+ export declare function showFeature(cfg: EditorConfig, f: FeatureKey): boolean;
437
+ /**
438
+ * Resolve whether a palette should render.
439
+ *
440
+ * Two gates:
441
+ * 1. `enable_palettes` is not explicitly `false`. When the
442
+ * palettes feature is off, *all* palettes are forced visible —
443
+ * the visibility map is a UI toggle, not a kill switch, so
444
+ * hiding the toggle UI must not silently hide content.
445
+ * 2. `panelVisibility[id]` is not explicitly `false` (absent or
446
+ * `true` means visible).
447
+ *
448
+ * @public
449
+ */
450
+ export declare function isPanelVisible(cfg: EditorConfig, id: PaletteId): boolean;
451
+ export {};
69
452
  //# sourceMappingURL=editor-config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"editor-config.d.ts","sourceRoot":"","sources":["../../src/lib/editor-config.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,YAAY;IAE3B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,sBAAsB,EAAE,OAAO,CAAC;IAChC,iBAAiB,EAAE,OAAO,CAAC;IAG3B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,gBAAgB,EAAE,OAAO,CAAC;IAC1B,iBAAiB,EAAE,OAAO,CAAC;IAC3B,qBAAqB,EAAE,OAAO,CAAC;IAC/B,kBAAkB,EAAE,OAAO,CAAC;IAC5B,oBAAoB,EAAE,OAAO,CAAC;IAC9B,sBAAsB,EAAE,OAAO,CAAC;IAChC,kBAAkB,EAAE,OAAO,CAAC;IAG5B,mBAAmB,EAAE,OAAO,CAAC;IAC7B,wBAAwB,EAAE,OAAO,CAAC;IAClC,uBAAuB,EAAE,OAAO,CAAC;IAGjC,kBAAkB,EAAE,OAAO,CAAC;IAC5B,0BAA0B,EAAE,OAAO,CAAC;CACrC;AAED;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,EAAE,YA4BnC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,EAAE,OAAO,CAAC,YAAY,CAItD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,OAAO,CAAC,YAAY,CAAM,CA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;;;;8BAI0B;IAC1B,oBAAoB,EAAE,OAAO,CAAC;IAC9B;;;;6CAIyC;IACzC,0BAA0B,EAAE,OAAO,CAAC;IACpC;;;;qEAIiE;IACjE,uBAAuB,EAAE,OAAO,CAAC;IACjC;;;;;qBAKiB;IACjB,sBAAsB,EAAE,OAAO,CAAC;IAGhC;;;;;OAKG;IACH,eAAe,CAAC,EAAE,OAAO,CAAC,MAAM,CAAC,SAAS,EAAE,OAAO,CAAC,CAAC,CAAC;IAEtD;;;;;;;;;OASG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAEvC;;;;OAIG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CACtC;AAED;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,EAAE,YAwEnC,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,EAAE,OAAO,CAAC,YAAY,CAGtD,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,EAAE,OAAO,CAAC,YAAY,CAAM,CAAC;AAE5D;;;;;GAKG;AACH,wBAAgB,aAAa,CAC3B,IAAI,EAAE,OAAO,GAAG,KAAK,EACrB,iBAAiB,CAAC,EAAE,OAAO,CAAC,YAAY,CAAC,GACxC,YAAY,CAGd;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,YAAY,EAAE,CAAC,EAAE,UAAU,GAAG,OAAO,CAMrE;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,YAAY,EAAE,EAAE,EAAE,SAAS,GAAG,OAAO,CAGxE"}
@@ -1,4 +1,5 @@
1
1
  // SPDX-License-Identifier: AGPL-3.0-or-later
2
+ import { isUnwired } from "./unwired";
2
3
  /**
3
4
  * Default flag set — every feature on. Hosts that want a minimal
4
5
  * embed (e.g. an inline `<EditorApp>` on a landing page) layer their
@@ -29,11 +30,55 @@ export const DEFAULT_EDITOR_CONFIG = {
29
30
  enable_bleed_input: true,
30
31
  // Panels
31
32
  enable_layers_panel: true,
32
- enable_separations_panel: true,
33
33
  enable_preflight_banner: true,
34
+ enable_palettes: true,
35
+ enable_separations: true,
36
+ enable_dieline_parameters: true,
37
+ enable_dieline_preview: true,
38
+ enable_inks_panel: true,
39
+ enable_swatches: true,
40
+ enable_white_underbase: true,
41
+ enable_panel_anchored_objects: true,
42
+ enable_compliance_panel: true,
43
+ enable_process_rules_panel: true,
44
+ enable_preflight_diff: true,
45
+ enable_brand_assets_panel: true,
46
+ enable_history: true,
47
+ enable_dieline_import: true,
48
+ enable_annotation_overlay: true,
49
+ enable_variant_matrix_versions: true,
50
+ enable_mark_library: true,
51
+ enable_slack_notify: true,
52
+ enable_preflight_autofix: true,
53
+ enable_smart_spot_match: true,
54
+ enable_design_suggestions: true,
55
+ enable_annotations_sidebar: true,
56
+ enable_brand_consistency: true,
57
+ enable_webhook_notify: true,
58
+ enable_email_notify: true,
59
+ enable_accessibility_hints: true,
60
+ enable_palette_to_spot: true,
61
+ // Job setup
62
+ enable_print_context: true,
34
63
  // Canvas
35
64
  enable_canvas_grid: true,
36
65
  enable_bleed_visualization: true,
66
+ enable_total_ink_coverage_live: true,
67
+ enable_trap_preview: true,
68
+ enable_trap_editor: true,
69
+ enable_impose: true,
70
+ enable_3d_fold_preview: true,
71
+ enable_fold_editor: true,
72
+ enable_mis_estimate: true,
73
+ enable_process_preflight: true,
74
+ enable_soft_proof: true,
75
+ enable_variant_matrix: true,
76
+ enable_barcode_generate: true,
77
+ enable_barcode_validation: true,
78
+ enable_gs1_digital_link: true,
79
+ enable_nutrition_panel: true,
80
+ enable_braille_panel: true,
81
+ enable_variable_data_merge: true,
37
82
  };
38
83
  /**
39
84
  * Basic-mode preset: hides the heavyweight pro panels and the source
@@ -44,7 +89,6 @@ export const DEFAULT_EDITOR_CONFIG = {
44
89
  */
45
90
  export const BASIC_MODE_OVERRIDES = {
46
91
  enable_layers_panel: false,
47
- enable_separations_panel: false,
48
92
  enable_source_link: false,
49
93
  };
50
94
  /**
@@ -63,4 +107,47 @@ export function resolveConfig(mode, instanceOverrides) {
63
107
  const modeOverrides = mode === "basic" ? BASIC_MODE_OVERRIDES : PRO_MODE_OVERRIDES;
64
108
  return { ...DEFAULT_EDITOR_CONFIG, ...modeOverrides, ...instanceOverrides };
65
109
  }
110
+ /**
111
+ * Resolve whether a feature should be visible right now.
112
+ *
113
+ * Evaluates four gates and returns true iff *all* are open:
114
+ * 1. `enable_<f>` is not explicitly `false`.
115
+ * 2. `plan_gates[f]` is not explicitly `false` (absent = open).
116
+ * 3. `capabilities[f]` is not explicitly `false` (absent = open).
117
+ * 4. `f` hasn't been marked unwired via
118
+ * {@link import("./unwired").markUnwired}.
119
+ *
120
+ * Use this at every render site that gates a feature; the four-layer
121
+ * separation lets hosts distinguish "we hid it" from "the plan
122
+ * doesn't include it" from "the backend can't do it right now" from
123
+ * "the editor build doesn't ship this UI yet" without losing the
124
+ * underlying boolean flag.
125
+ *
126
+ * @public
127
+ */
128
+ export function showFeature(cfg, f) {
129
+ const enabled = cfg[`enable_${f}`] !== false;
130
+ const plan = cfg.plan_gates?.[f] !== false;
131
+ const capable = cfg.capabilities?.[f] !== false;
132
+ const wired = !isUnwired(f);
133
+ return enabled && plan && capable && wired;
134
+ }
135
+ /**
136
+ * Resolve whether a palette should render.
137
+ *
138
+ * Two gates:
139
+ * 1. `enable_palettes` is not explicitly `false`. When the
140
+ * palettes feature is off, *all* palettes are forced visible —
141
+ * the visibility map is a UI toggle, not a kill switch, so
142
+ * hiding the toggle UI must not silently hide content.
143
+ * 2. `panelVisibility[id]` is not explicitly `false` (absent or
144
+ * `true` means visible).
145
+ *
146
+ * @public
147
+ */
148
+ export function isPanelVisible(cfg, id) {
149
+ if (cfg.enable_palettes === false)
150
+ return true;
151
+ return cfg.panelVisibility?.[id] !== false;
152
+ }
66
153
  //# sourceMappingURL=editor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