@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.
- package/LICENSE +62 -0
- package/README.md +63 -2
- package/dist/components/AccessibilityHintsPanel.d.ts +142 -0
- package/dist/components/AccessibilityHintsPanel.d.ts.map +1 -0
- package/dist/components/AccessibilityHintsPanel.js +158 -0
- package/dist/components/AccessibilityHintsPanel.js.map +1 -0
- package/dist/components/AnnotationOverlay.d.ts +142 -0
- package/dist/components/AnnotationOverlay.d.ts.map +1 -0
- package/dist/components/AnnotationOverlay.js +141 -0
- package/dist/components/AnnotationOverlay.js.map +1 -0
- package/dist/components/AnnotationsSidebar.d.ts +98 -0
- package/dist/components/AnnotationsSidebar.d.ts.map +1 -0
- package/dist/components/AnnotationsSidebar.js +100 -0
- package/dist/components/AnnotationsSidebar.js.map +1 -0
- package/dist/components/BarcodeGeneratorPanel.d.ts +58 -0
- package/dist/components/BarcodeGeneratorPanel.d.ts.map +1 -0
- package/dist/components/BarcodeGeneratorPanel.js +91 -0
- package/dist/components/BarcodeGeneratorPanel.js.map +1 -0
- package/dist/components/BraillePanel.d.ts +99 -0
- package/dist/components/BraillePanel.d.ts.map +1 -0
- package/dist/components/BraillePanel.js +221 -0
- package/dist/components/BraillePanel.js.map +1 -0
- package/dist/components/BrandAssetsPanel.d.ts +130 -0
- package/dist/components/BrandAssetsPanel.d.ts.map +1 -0
- package/dist/components/BrandAssetsPanel.js +125 -0
- package/dist/components/BrandAssetsPanel.js.map +1 -0
- package/dist/components/BrandConsistencyPanel.d.ts +140 -0
- package/dist/components/BrandConsistencyPanel.d.ts.map +1 -0
- package/dist/components/BrandConsistencyPanel.js +158 -0
- package/dist/components/BrandConsistencyPanel.js.map +1 -0
- package/dist/components/ComplianceFindingsPanel.d.ts +62 -0
- package/dist/components/ComplianceFindingsPanel.d.ts.map +1 -0
- package/dist/components/ComplianceFindingsPanel.js +118 -0
- package/dist/components/ComplianceFindingsPanel.js.map +1 -0
- package/dist/components/DesignSuggestionsPanel.d.ts +148 -0
- package/dist/components/DesignSuggestionsPanel.d.ts.map +1 -0
- package/dist/components/DesignSuggestionsPanel.js +154 -0
- package/dist/components/DesignSuggestionsPanel.js.map +1 -0
- package/dist/components/DielineParametersPanel.d.ts +62 -0
- package/dist/components/DielineParametersPanel.d.ts.map +1 -0
- package/dist/components/DielineParametersPanel.js +170 -0
- package/dist/components/DielineParametersPanel.js.map +1 -0
- package/dist/components/DielinePreview.d.ts +150 -0
- package/dist/components/DielinePreview.d.ts.map +1 -0
- package/dist/components/DielinePreview.js +146 -0
- package/dist/components/DielinePreview.js.map +1 -0
- package/dist/components/EditorApp.d.ts +39 -5
- package/dist/components/EditorApp.d.ts.map +1 -1
- package/dist/components/EditorApp.js +110 -5
- package/dist/components/EditorApp.js.map +1 -1
- package/dist/components/EditorCanvas.d.ts +51 -2
- package/dist/components/EditorCanvas.d.ts.map +1 -1
- package/dist/components/EditorCanvas.js +117 -48
- package/dist/components/EditorCanvas.js.map +1 -1
- package/dist/components/EmailNotifyPanel.d.ts +165 -0
- package/dist/components/EmailNotifyPanel.d.ts.map +1 -0
- package/dist/components/EmailNotifyPanel.js +211 -0
- package/dist/components/EmailNotifyPanel.js.map +1 -0
- package/dist/components/FileDropZone.d.ts +9 -1
- package/dist/components/FileDropZone.d.ts.map +1 -1
- package/dist/components/FileDropZone.js +53 -5
- package/dist/components/FileDropZone.js.map +1 -1
- package/dist/components/FoldEditorPanel.d.ts +68 -0
- package/dist/components/FoldEditorPanel.d.ts.map +1 -0
- package/dist/components/FoldEditorPanel.js +65 -0
- package/dist/components/FoldEditorPanel.js.map +1 -0
- package/dist/components/FoldPreviewOverlay.d.ts +48 -0
- package/dist/components/FoldPreviewOverlay.d.ts.map +1 -0
- package/dist/components/FoldPreviewOverlay.js +182 -0
- package/dist/components/FoldPreviewOverlay.js.map +1 -0
- package/dist/components/Gs1DigitalLinkPanel.d.ts +103 -0
- package/dist/components/Gs1DigitalLinkPanel.d.ts.map +1 -0
- package/dist/components/Gs1DigitalLinkPanel.js +199 -0
- package/dist/components/Gs1DigitalLinkPanel.js.map +1 -0
- package/dist/components/HistoryPanel.d.ts +39 -0
- package/dist/components/HistoryPanel.d.ts.map +1 -0
- package/dist/components/HistoryPanel.js +72 -0
- package/dist/components/HistoryPanel.js.map +1 -0
- package/dist/components/IccSoftProofOverlay.d.ts +67 -0
- package/dist/components/IccSoftProofOverlay.d.ts.map +1 -0
- package/dist/components/IccSoftProofOverlay.js +119 -0
- package/dist/components/IccSoftProofOverlay.js.map +1 -0
- package/dist/components/ImposePanel.d.ts +71 -0
- package/dist/components/ImposePanel.d.ts.map +1 -0
- package/dist/components/ImposePanel.js +127 -0
- package/dist/components/ImposePanel.js.map +1 -0
- package/dist/components/InksPanel.d.ts +61 -0
- package/dist/components/InksPanel.d.ts.map +1 -0
- package/dist/components/InksPanel.js +84 -0
- package/dist/components/InksPanel.js.map +1 -0
- package/dist/components/JobSetupPanel.d.ts +118 -0
- package/dist/components/JobSetupPanel.d.ts.map +1 -0
- package/dist/components/JobSetupPanel.js +169 -0
- package/dist/components/JobSetupPanel.js.map +1 -0
- package/dist/components/LayersPanel.d.ts.map +1 -1
- package/dist/components/LayersPanel.js +1 -0
- package/dist/components/LayersPanel.js.map +1 -1
- package/dist/components/MarkLibraryPanel.d.ts +131 -0
- package/dist/components/MarkLibraryPanel.d.ts.map +1 -0
- package/dist/components/MarkLibraryPanel.js +184 -0
- package/dist/components/MarkLibraryPanel.js.map +1 -0
- package/dist/components/MisEstimateButton.d.ts +73 -0
- package/dist/components/MisEstimateButton.d.ts.map +1 -0
- package/dist/components/MisEstimateButton.js +57 -0
- package/dist/components/MisEstimateButton.js.map +1 -0
- package/dist/components/NutritionPanel.d.ts +118 -0
- package/dist/components/NutritionPanel.d.ts.map +1 -0
- package/dist/components/NutritionPanel.js +169 -0
- package/dist/components/NutritionPanel.js.map +1 -0
- package/dist/components/PageNavigator.d.ts +26 -0
- package/dist/components/PageNavigator.d.ts.map +1 -0
- package/dist/components/PageNavigator.js +96 -0
- package/dist/components/PageNavigator.js.map +1 -0
- package/dist/components/PaletteManager.d.ts +32 -0
- package/dist/components/PaletteManager.d.ts.map +1 -0
- package/dist/components/PaletteManager.js +89 -0
- package/dist/components/PaletteManager.js.map +1 -0
- package/dist/components/PaletteToSpotPanel.d.ts +122 -0
- package/dist/components/PaletteToSpotPanel.d.ts.map +1 -0
- package/dist/components/PaletteToSpotPanel.js +160 -0
- package/dist/components/PaletteToSpotPanel.js.map +1 -0
- package/dist/components/PreflightAutoFixPanel.d.ts +110 -0
- package/dist/components/PreflightAutoFixPanel.d.ts.map +1 -0
- package/dist/components/PreflightAutoFixPanel.js +119 -0
- package/dist/components/PreflightAutoFixPanel.js.map +1 -0
- package/dist/components/PreflightDiffPanel.d.ts +127 -0
- package/dist/components/PreflightDiffPanel.d.ts.map +1 -0
- package/dist/components/PreflightDiffPanel.js +0 -0
- package/dist/components/PreflightDiffPanel.js.map +1 -0
- package/dist/components/ProcessRulesPanel.d.ts +81 -0
- package/dist/components/ProcessRulesPanel.d.ts.map +1 -0
- package/dist/components/ProcessRulesPanel.js +143 -0
- package/dist/components/ProcessRulesPanel.js.map +1 -0
- package/dist/components/SlackNotifyPanel.d.ts +139 -0
- package/dist/components/SlackNotifyPanel.d.ts.map +1 -0
- package/dist/components/SlackNotifyPanel.js +133 -0
- package/dist/components/SlackNotifyPanel.js.map +1 -0
- package/dist/components/SmartSpotMatchPanel.d.ts +143 -0
- package/dist/components/SmartSpotMatchPanel.d.ts.map +1 -0
- package/dist/components/SmartSpotMatchPanel.js +159 -0
- package/dist/components/SmartSpotMatchPanel.js.map +1 -0
- package/dist/components/SwatchesPicker.d.ts +83 -0
- package/dist/components/SwatchesPicker.d.ts.map +1 -0
- package/dist/components/SwatchesPicker.js +151 -0
- package/dist/components/SwatchesPicker.js.map +1 -0
- package/dist/components/TacOverlay.d.ts +47 -0
- package/dist/components/TacOverlay.d.ts.map +1 -0
- package/dist/components/TacOverlay.js +116 -0
- package/dist/components/TacOverlay.js.map +1 -0
- package/dist/components/TrapEditorPanel.d.ts +52 -0
- package/dist/components/TrapEditorPanel.d.ts.map +1 -0
- package/dist/components/TrapEditorPanel.js +64 -0
- package/dist/components/TrapEditorPanel.js.map +1 -0
- package/dist/components/TrapPreviewOverlay.d.ts +64 -0
- package/dist/components/TrapPreviewOverlay.d.ts.map +1 -0
- package/dist/components/TrapPreviewOverlay.js +120 -0
- package/dist/components/TrapPreviewOverlay.js.map +1 -0
- package/dist/components/VariantMatrixPanel.d.ts +61 -0
- package/dist/components/VariantMatrixPanel.d.ts.map +1 -0
- package/dist/components/VariantMatrixPanel.js +97 -0
- package/dist/components/VariantMatrixPanel.js.map +1 -0
- package/dist/components/VariantMatrixVersionPanel.d.ts +122 -0
- package/dist/components/VariantMatrixVersionPanel.d.ts.map +1 -0
- package/dist/components/VariantMatrixVersionPanel.js +162 -0
- package/dist/components/VariantMatrixVersionPanel.js.map +1 -0
- package/dist/components/WebhookNotifyPanel.d.ts +160 -0
- package/dist/components/WebhookNotifyPanel.d.ts.map +1 -0
- package/dist/components/WebhookNotifyPanel.js +100 -0
- package/dist/components/WebhookNotifyPanel.js.map +1 -0
- package/dist/components/WhiteUnderbasePanel.d.ts +107 -0
- package/dist/components/WhiteUnderbasePanel.d.ts.map +1 -0
- package/dist/components/WhiteUnderbasePanel.js +104 -0
- package/dist/components/WhiteUnderbasePanel.js.map +1 -0
- package/dist/data/dielines.json +35 -0
- package/dist/hooks/useEditorMode.d.ts +25 -5
- package/dist/hooks/useEditorMode.d.ts.map +1 -1
- package/dist/hooks/useEditorMode.js +18 -5
- package/dist/hooks/useEditorMode.js.map +1 -1
- package/dist/index.d.ts +49 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +49 -2
- package/dist/index.js.map +1 -1
- package/dist/lens/dieline-overlay.d.ts +25 -0
- package/dist/lens/dieline-overlay.d.ts.map +1 -0
- package/dist/lens/dieline-overlay.js +50 -0
- package/dist/lens/dieline-overlay.js.map +1 -0
- package/dist/lens/index.d.ts +27 -0
- package/dist/lens/index.d.ts.map +1 -0
- package/dist/lens/index.js +28 -0
- package/dist/lens/index.js.map +1 -0
- package/dist/lens/preflight-findings.d.ts +21 -0
- package/dist/lens/preflight-findings.d.ts.map +1 -0
- package/dist/lens/preflight-findings.js +82 -0
- package/dist/lens/preflight-findings.js.map +1 -0
- package/dist/lib/barcode-scan.d.ts +154 -0
- package/dist/lib/barcode-scan.d.ts.map +1 -0
- package/dist/lib/barcode-scan.js +152 -0
- package/dist/lib/barcode-scan.js.map +1 -0
- package/dist/lib/color-math.d.ts +76 -0
- package/dist/lib/color-math.d.ts.map +1 -0
- package/dist/lib/color-math.js +96 -0
- package/dist/lib/color-math.js.map +1 -0
- package/dist/lib/dieline-template.d.ts +169 -0
- package/dist/lib/dieline-template.d.ts.map +1 -1
- package/dist/lib/dieline-template.js +229 -1
- package/dist/lib/dieline-template.js.map +1 -1
- package/dist/lib/editor-config.d.ts +384 -1
- package/dist/lib/editor-config.d.ts.map +1 -1
- package/dist/lib/editor-config.js +89 -2
- package/dist/lib/editor-config.js.map +1 -1
- package/dist/lib/fold-geometry.d.ts +144 -0
- package/dist/lib/fold-geometry.d.ts.map +1 -0
- package/dist/lib/fold-geometry.js +138 -0
- package/dist/lib/fold-geometry.js.map +1 -0
- package/dist/lib/merge-tokens.d.ts +81 -0
- package/dist/lib/merge-tokens.d.ts.map +1 -0
- package/dist/lib/merge-tokens.js +88 -0
- package/dist/lib/merge-tokens.js.map +1 -0
- package/dist/lib/palette-registry.d.ts +40 -0
- package/dist/lib/palette-registry.d.ts.map +1 -0
- package/dist/lib/palette-registry.js +49 -0
- package/dist/lib/palette-registry.js.map +1 -0
- package/dist/lib/panel-anchor.d.ts +101 -0
- package/dist/lib/panel-anchor.d.ts.map +1 -0
- package/dist/lib/panel-anchor.js +68 -0
- package/dist/lib/panel-anchor.js.map +1 -0
- package/dist/lib/preflight/checks.d.ts.map +1 -1
- package/dist/lib/preflight/checks.js +71 -0
- package/dist/lib/preflight/checks.js.map +1 -1
- package/dist/lib/preflight/types.d.ts.map +1 -1
- package/dist/lib/preflight/types.js +11 -0
- package/dist/lib/preflight/types.js.map +1 -1
- package/dist/lib/rasterize.d.ts +93 -0
- package/dist/lib/rasterize.d.ts.map +1 -0
- package/dist/lib/rasterize.js +117 -0
- package/dist/lib/rasterize.js.map +1 -0
- package/dist/lib/separations-registry.d.ts +99 -0
- package/dist/lib/separations-registry.d.ts.map +1 -0
- package/dist/lib/separations-registry.js +59 -0
- package/dist/lib/separations-registry.js.map +1 -0
- package/dist/lib/unwired.d.ts +29 -0
- package/dist/lib/unwired.d.ts.map +1 -0
- package/dist/lib/unwired.js +58 -0
- package/dist/lib/unwired.js.map +1 -0
- package/package.json +29 -11
- package/dist/components/SeparationsPanel.d.ts +0 -9
- package/dist/components/SeparationsPanel.d.ts.map +0 -1
- package/dist/components/SeparationsPanel.js +0 -168
- package/dist/components/SeparationsPanel.js.map +0 -1
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-page registry of named spot inks the editor has identified.
|
|
3
|
+
*
|
|
4
|
+
* AI4 ("palette → spot") feeds this registry every time the user
|
|
5
|
+
* marks a fill or stroke color as a spot ink. The list rides on the
|
|
6
|
+
* page (see `Page.separations` in `dieline-template.ts`) and gets
|
|
7
|
+
* threaded through to compile-pdf via the
|
|
8
|
+
* `JobSubmitRequest.separationsOverride` field — bypassing the
|
|
9
|
+
* renderer's inference of separations from the document content.
|
|
10
|
+
*
|
|
11
|
+
* Wave 1 PR-7 (C3 SwatchesPicker) adds a "from library" flow that
|
|
12
|
+
* pre-fills `pantone` + `lab` via the compile-pdf spots endpoint.
|
|
13
|
+
* For now, the registry handles ad-hoc registration with whatever
|
|
14
|
+
* metadata the user has (a name, optionally a Pantone code).
|
|
15
|
+
*
|
|
16
|
+
* The helpers in this file are pure — they take an array and return
|
|
17
|
+
* a new array. State is owned by the caller (Page / EditorApp).
|
|
18
|
+
*/
|
|
19
|
+
/**
|
|
20
|
+
* Editor-side mirror of `@artworkpdf/document-model`'s `Separation`.
|
|
21
|
+
*
|
|
22
|
+
* Kept structural (not an import from document-model) so the
|
|
23
|
+
* editor-app package stays consumable by hosts that don't pull
|
|
24
|
+
* document-model in. The wire serialization is structurally
|
|
25
|
+
* compatible — when the export builder populates
|
|
26
|
+
* `separationsOverride` on the job request, an `EditorSeparation[]`
|
|
27
|
+
* satisfies the document-model `Separation[]` shape.
|
|
28
|
+
*
|
|
29
|
+
* @public
|
|
30
|
+
*/
|
|
31
|
+
export type EditorSeparation = {
|
|
32
|
+
/** Display name and the channel identity (e.g. `"PANTONE 185 C"`). */
|
|
33
|
+
name: string;
|
|
34
|
+
/** PDF color space. Spots use `"Spot"`; process inks use `"CMYK"`. */
|
|
35
|
+
colorSpace: "CMYK" | "Spot" | "DeviceN" | "RGB" | "Gray";
|
|
36
|
+
/** The source hex this spot was registered from (`#fc5102`). */
|
|
37
|
+
hex: string;
|
|
38
|
+
/** Canonical Pantone reference name, when known. */
|
|
39
|
+
pantone?: string;
|
|
40
|
+
/** Measured Lab triplet, when known (filled by C3's SwatchesPicker). */
|
|
41
|
+
lab?: {
|
|
42
|
+
L: number;
|
|
43
|
+
a: number;
|
|
44
|
+
b: number;
|
|
45
|
+
};
|
|
46
|
+
/** Channel type — informs the renderer's downstream handling. */
|
|
47
|
+
type?: "ink" | "varnish" | "foil" | "emboss" | "white";
|
|
48
|
+
};
|
|
49
|
+
/**
|
|
50
|
+
* Options accepted by {@link registerSpot} beyond the required name.
|
|
51
|
+
*
|
|
52
|
+
* @public
|
|
53
|
+
*/
|
|
54
|
+
export type RegisterSpotOptions = {
|
|
55
|
+
pantone?: string;
|
|
56
|
+
lab?: {
|
|
57
|
+
L: number;
|
|
58
|
+
a: number;
|
|
59
|
+
b: number;
|
|
60
|
+
};
|
|
61
|
+
type?: EditorSeparation["type"];
|
|
62
|
+
colorSpace?: EditorSeparation["colorSpace"];
|
|
63
|
+
};
|
|
64
|
+
/**
|
|
65
|
+
* Add (or replace) a spot keyed by `hex`. Idempotent — registering
|
|
66
|
+
* the same hex twice updates the existing entry rather than
|
|
67
|
+
* appending a duplicate. Comparison is case-insensitive.
|
|
68
|
+
*
|
|
69
|
+
* @returns A new array with the spot present. The input is not
|
|
70
|
+
* mutated.
|
|
71
|
+
*
|
|
72
|
+
* @public
|
|
73
|
+
*/
|
|
74
|
+
export declare function registerSpot(seps: readonly EditorSeparation[], hex: string, name: string, opts?: RegisterSpotOptions): EditorSeparation[];
|
|
75
|
+
/**
|
|
76
|
+
* Remove a spot by hex. No-op if absent.
|
|
77
|
+
*
|
|
78
|
+
* @returns A new array with the matching entry removed.
|
|
79
|
+
*
|
|
80
|
+
* @public
|
|
81
|
+
*/
|
|
82
|
+
export declare function unregisterSpot(seps: readonly EditorSeparation[], hex: string): EditorSeparation[];
|
|
83
|
+
/**
|
|
84
|
+
* Lookup a registered spot by hex. Case-insensitive.
|
|
85
|
+
*
|
|
86
|
+
* @returns The matching `EditorSeparation` or `undefined`.
|
|
87
|
+
*
|
|
88
|
+
* @public
|
|
89
|
+
*/
|
|
90
|
+
export declare function findSpotByColor(seps: readonly EditorSeparation[], hex: string): EditorSeparation | undefined;
|
|
91
|
+
/**
|
|
92
|
+
* Identity helper — returns the list as-is for symmetry with the
|
|
93
|
+
* other registry verbs. Use this at the export site to thread the
|
|
94
|
+
* page's spots into `JobSubmitRequest.separationsOverride`.
|
|
95
|
+
*
|
|
96
|
+
* @public
|
|
97
|
+
*/
|
|
98
|
+
export declare function listSpots(seps: readonly EditorSeparation[]): EditorSeparation[];
|
|
99
|
+
//# sourceMappingURL=separations-registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"separations-registry.d.ts","sourceRoot":"","sources":["../../src/lib/separations-registry.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;;;;;;;;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7B,IAAI,EAAE,SAAS,gBAAgB,EAAE,EACjC,GAAG,EAAE,MAAM,GACV,gBAAgB,GAAG,SAAS,CAG9B;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,SAAS,gBAAgB,EAAE,GAAG,gBAAgB,EAAE,CAE/E"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
2
|
+
/**
|
|
3
|
+
* Add (or replace) a spot keyed by `hex`. Idempotent — registering
|
|
4
|
+
* the same hex twice updates the existing entry rather than
|
|
5
|
+
* appending a duplicate. Comparison is case-insensitive.
|
|
6
|
+
*
|
|
7
|
+
* @returns A new array with the spot present. The input is not
|
|
8
|
+
* mutated.
|
|
9
|
+
*
|
|
10
|
+
* @public
|
|
11
|
+
*/
|
|
12
|
+
export function registerSpot(seps, hex, name, opts = {}) {
|
|
13
|
+
const normalized = hex.toLowerCase();
|
|
14
|
+
const next = {
|
|
15
|
+
name,
|
|
16
|
+
colorSpace: opts.colorSpace ?? "Spot",
|
|
17
|
+
hex: normalized,
|
|
18
|
+
...(opts.pantone !== undefined ? { pantone: opts.pantone } : {}),
|
|
19
|
+
...(opts.lab !== undefined ? { lab: opts.lab } : {}),
|
|
20
|
+
...(opts.type !== undefined ? { type: opts.type } : {}),
|
|
21
|
+
};
|
|
22
|
+
const existingIdx = seps.findIndex((s) => s.hex.toLowerCase() === normalized);
|
|
23
|
+
if (existingIdx === -1)
|
|
24
|
+
return [...seps, next];
|
|
25
|
+
return seps.map((s, i) => (i === existingIdx ? next : s));
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Remove a spot by hex. No-op if absent.
|
|
29
|
+
*
|
|
30
|
+
* @returns A new array with the matching entry removed.
|
|
31
|
+
*
|
|
32
|
+
* @public
|
|
33
|
+
*/
|
|
34
|
+
export function unregisterSpot(seps, hex) {
|
|
35
|
+
const normalized = hex.toLowerCase();
|
|
36
|
+
return seps.filter((s) => s.hex.toLowerCase() !== normalized);
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Lookup a registered spot by hex. Case-insensitive.
|
|
40
|
+
*
|
|
41
|
+
* @returns The matching `EditorSeparation` or `undefined`.
|
|
42
|
+
*
|
|
43
|
+
* @public
|
|
44
|
+
*/
|
|
45
|
+
export function findSpotByColor(seps, hex) {
|
|
46
|
+
const normalized = hex.toLowerCase();
|
|
47
|
+
return seps.find((s) => s.hex.toLowerCase() === normalized);
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Identity helper — returns the list as-is for symmetry with the
|
|
51
|
+
* other registry verbs. Use this at the export site to thread the
|
|
52
|
+
* page's spots into `JobSubmitRequest.separationsOverride`.
|
|
53
|
+
*
|
|
54
|
+
* @public
|
|
55
|
+
*/
|
|
56
|
+
export function listSpots(seps) {
|
|
57
|
+
return [...seps];
|
|
58
|
+
}
|
|
59
|
+
//# sourceMappingURL=separations-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"separations-registry.js","sourceRoot":"","sources":["../../src/lib/separations-registry.ts"],"names":[],"mappings":"AAAA,6CAA6C;AA4D7C;;;;;;;;;GASG;AACH,MAAM,UAAU,YAAY,CAC1B,IAAiC,EACjC,GAAW,EACX,IAAY,EACZ,OAA4B,EAAE;IAE9B,MAAM,UAAU,GAAG,GAAG,CAAC,WAAW,EAAE,CAAC;IACrC,MAAM,IAAI,GAAqB;QAC7B,IAAI;QACJ,UAAU,EAAE,IAAI,CAAC,UAAU,IAAI,MAAM;QACrC,GAAG,EAAE,UAAU;QACf,GAAG,CAAC,IAAI,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QAChE,GAAG,CAAC,IAAI,CAAC,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,IAAI,CAAC,GAAG,EA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-0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Mark a feature as "flag exists but UI not shipped". Idempotent.
|
|
3
|
+
*
|
|
4
|
+
* Typical call site is at the bottom of the module that *would*
|
|
5
|
+
* render the UI when wired:
|
|
6
|
+
*
|
|
7
|
+
* ```ts
|
|
8
|
+
* // packages/editor-app/src/components/SeparationsPanel.tsx
|
|
9
|
+
* import { markUnwired } from "../lib/unwired";
|
|
10
|
+
* markUnwired("separations"); // wire-up lands in Wave 1
|
|
11
|
+
* ```
|
|
12
|
+
*
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
export declare function markUnwired(feature: string): void;
|
|
16
|
+
/**
|
|
17
|
+
* Test whether a feature has been marked unwired. Used by
|
|
18
|
+
* {@link import("./editor-config").showFeature}; hosts generally
|
|
19
|
+
* don't need to call this directly.
|
|
20
|
+
*
|
|
21
|
+
* @public
|
|
22
|
+
*/
|
|
23
|
+
export declare function isUnwired(feature: string): boolean;
|
|
24
|
+
/**
|
|
25
|
+
* Test-only — clear the unwired set. Not exported through the
|
|
26
|
+
* public barrel.
|
|
27
|
+
*/
|
|
28
|
+
export declare function _resetUnwiredForTests(): void;
|
|
29
|
+
//# sourceMappingURL=unwired.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unwired.d.ts","sourceRoot":"","sources":["../../src/lib/unwired.ts"],"names":[],"mappings":"AA0BA;;;;;;;;;;;;;GAaG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAEjD;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAElD;AAED;;;GAGG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAE5C"}
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
2
|
+
/**
|
|
3
|
+
* Unwired-feature registry.
|
|
4
|
+
*
|
|
5
|
+
* A feature is "unwired" when the *flag* exists in {@link EditorConfig}
|
|
6
|
+
* but the corresponding *UI* isn't shipped in this build yet (typical
|
|
7
|
+
* for forward-compatibility plumb-throughs like `enable_separations`
|
|
8
|
+
* — flag preps the surface; component lands in a later wave).
|
|
9
|
+
*
|
|
10
|
+
* Mirrors the pattern from `lens-pdf`. The set is module-scoped and
|
|
11
|
+
* in-memory only — there's no persistence. Components / packages
|
|
12
|
+
* call {@link markUnwired} at module-init time; {@link showFeature}
|
|
13
|
+
* reads via {@link isUnwired} to suppress UI for features whose flag
|
|
14
|
+
* is on but whose implementation hasn't landed.
|
|
15
|
+
*
|
|
16
|
+
* **The registry itself is the source of truth.** When no module
|
|
17
|
+
* calls `markUnwired(...)`, every flagged feature ships live;
|
|
18
|
+
* adding plumb-only flags in future waves means landing a
|
|
19
|
+
* `markUnwired("<feature>")` call alongside the flag and removing
|
|
20
|
+
* it when the UI ships. `grep -rn 'markUnwired(' packages/editor-app/src`
|
|
21
|
+
* reports the current set without doc maintenance.
|
|
22
|
+
*/
|
|
23
|
+
const UNWIRED = new Set();
|
|
24
|
+
/**
|
|
25
|
+
* Mark a feature as "flag exists but UI not shipped". Idempotent.
|
|
26
|
+
*
|
|
27
|
+
* Typical call site is at the bottom of the module that *would*
|
|
28
|
+
* render the UI when wired:
|
|
29
|
+
*
|
|
30
|
+
* ```ts
|
|
31
|
+
* // packages/editor-app/src/components/SeparationsPanel.tsx
|
|
32
|
+
* import { markUnwired } from "../lib/unwired";
|
|
33
|
+
* markUnwired("separations"); // wire-up lands in Wave 1
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @public
|
|
37
|
+
*/
|
|
38
|
+
export function markUnwired(feature) {
|
|
39
|
+
UNWIRED.add(feature);
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Test whether a feature has been marked unwired. Used by
|
|
43
|
+
* {@link import("./editor-config").showFeature}; hosts generally
|
|
44
|
+
* don't need to call this directly.
|
|
45
|
+
*
|
|
46
|
+
* @public
|
|
47
|
+
*/
|
|
48
|
+
export function isUnwired(feature) {
|
|
49
|
+
return UNWIRED.has(feature);
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Test-only — clear the unwired set. Not exported through the
|
|
53
|
+
* public barrel.
|
|
54
|
+
*/
|
|
55
|
+
export function _resetUnwiredForTests() {
|
|
56
|
+
UNWIRED.clear();
|
|
57
|
+
}
|
|
58
|
+
//# sourceMappingURL=unwired.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unwired.js","sourceRoot":"","sources":["../../src/lib/unwired.ts"],"names":[],"mappings":"AAAA,6CAA6C;AAE7C;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,MAAM,OAAO,GAAG,IAAI,GAAG,EAAU,CAAC;AAElC;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,WAAW,CAAC,OAAe;IACzC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AACvB,CAAC;AAED;;;;;;GAMG;AACH,MAAM,UAAU,SAAS,CAAC,OAAe;IACvC,OAAO,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;AAC9B,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,qBAAqB;IACnC,OAAO,CAAC,KAAK,EAAE,CAAC;AAClB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@printwithsynergy/artwork-pdf-editor",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"description": "artworkPDF WYSIWYG editor as a host-customizable React component. Drop-in mountable in Next.js, Astro, Remix, etc.",
|
|
5
5
|
"license": "AGPL-3.0-or-later",
|
|
6
6
|
"type": "module",
|
|
@@ -10,35 +10,53 @@
|
|
|
10
10
|
".": {
|
|
11
11
|
"types": "./dist/index.d.ts",
|
|
12
12
|
"import": "./dist/index.js"
|
|
13
|
+
},
|
|
14
|
+
"./lens": {
|
|
15
|
+
"types": "./dist/lens/index.d.ts",
|
|
16
|
+
"import": "./dist/lens/index.js"
|
|
13
17
|
}
|
|
14
18
|
},
|
|
15
|
-
"files": [
|
|
19
|
+
"files": [
|
|
20
|
+
"dist",
|
|
21
|
+
"README.md",
|
|
22
|
+
"LICENSE"
|
|
23
|
+
],
|
|
16
24
|
"sideEffects": false,
|
|
17
|
-
"scripts": {
|
|
18
|
-
"build": "tsc -p tsconfig.build.json",
|
|
19
|
-
"typecheck": "tsc --noEmit",
|
|
20
|
-
"test": "vitest run --passWithNoTests"
|
|
21
|
-
},
|
|
22
25
|
"dependencies": {
|
|
23
|
-
"pdf-lib": "^1.17.1"
|
|
26
|
+
"pdf-lib": "^1.17.1",
|
|
27
|
+
"three": "^0.170.0",
|
|
28
|
+
"@artworkpdf/dieline-parser": "0.1.0"
|
|
24
29
|
},
|
|
25
30
|
"peerDependencies": {
|
|
26
31
|
"react": "^19.0.0",
|
|
27
32
|
"react-dom": "^19.0.0",
|
|
28
33
|
"react-konva": "^19.0.0",
|
|
29
|
-
"konva": "^10.3.0"
|
|
34
|
+
"konva": "^10.3.0",
|
|
35
|
+
"@printwithsynergy/lens-pdf": "^0.4.0-beta.17"
|
|
36
|
+
},
|
|
37
|
+
"peerDependenciesMeta": {
|
|
38
|
+
"@printwithsynergy/lens-pdf": {
|
|
39
|
+
"optional": true
|
|
40
|
+
}
|
|
30
41
|
},
|
|
31
42
|
"devDependencies": {
|
|
43
|
+
"@printwithsynergy/lens-pdf": "^0.4.0-beta.17",
|
|
32
44
|
"@types/react": "^19.0.0",
|
|
33
45
|
"@types/react-dom": "^19.0.0",
|
|
46
|
+
"@types/three": "^0.170.0",
|
|
34
47
|
"konva": "^10.3.0",
|
|
35
48
|
"react": "^19.0.0",
|
|
36
49
|
"react-dom": "^19.0.0",
|
|
37
50
|
"react-konva": "^19.0.0",
|
|
38
51
|
"typescript": "^5.7.0",
|
|
39
|
-
"vitest": "^
|
|
52
|
+
"vitest": "^4.1.0"
|
|
40
53
|
},
|
|
41
54
|
"publishConfig": {
|
|
42
55
|
"access": "public"
|
|
56
|
+
},
|
|
57
|
+
"scripts": {
|
|
58
|
+
"build": "tsc -p tsconfig.build.json",
|
|
59
|
+
"typecheck": "tsc --noEmit",
|
|
60
|
+
"test": "vitest run --passWithNoTests"
|
|
43
61
|
}
|
|
44
|
-
}
|
|
62
|
+
}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import type { CanvasObj } from "./EditorCanvas";
|
|
2
|
-
type Props = {
|
|
3
|
-
objects: CanvasObj[];
|
|
4
|
-
hidden: Set<string>;
|
|
5
|
-
onToggle: (color: string) => void;
|
|
6
|
-
};
|
|
7
|
-
export declare function SeparationsPanel({ objects, hidden, onToggle }: Props): import("react/jsx-runtime").JSX.Element;
|
|
8
|
-
export {};
|
|
9
|
-
//# sourceMappingURL=SeparationsPanel.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SeparationsPanel.d.ts","sourceRoot":"","sources":["../../src/components/SeparationsPanel.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAEhD,KAAK,KAAK,GAAG;IACX,OAAO,EAAE,SAAS,EAAE,CAAC;IACrB,MAAM,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACpB,QAAQ,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;CACnC,CAAC;AA6HF,wBAAgB,gBAAgB,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE,KAAK,2CAuGpE"}
|
|
@@ -1,168 +0,0 @@
|
|
|
1
|
-
// SPDX-License-Identifier: AGPL-3.0-or-later
|
|
2
|
-
"use client";
|
|
3
|
-
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
4
|
-
const PANEL = "#1a0f08";
|
|
5
|
-
const BORDER = "#3d1a00";
|
|
6
|
-
const MUTED = "#888";
|
|
7
|
-
function hexToRgb(hex) {
|
|
8
|
-
const m = /^#?([0-9a-f]{6})$/i.exec(hex);
|
|
9
|
-
if (!m)
|
|
10
|
-
return null;
|
|
11
|
-
const n = Number.parseInt(m[1], 16);
|
|
12
|
-
return [(n >> 16) & 0xff, (n >> 8) & 0xff, n & 0xff];
|
|
13
|
-
}
|
|
14
|
-
function isCmykPrimary(hex) {
|
|
15
|
-
const rgb = hexToRgb(hex);
|
|
16
|
-
if (!rgb)
|
|
17
|
-
return null;
|
|
18
|
-
const [r, g, b] = rgb;
|
|
19
|
-
if (r < 16 && g < 16 && b < 16)
|
|
20
|
-
return "K";
|
|
21
|
-
if (r > 220 && g < 60 && b < 60)
|
|
22
|
-
return null; // pure red → treated as spot
|
|
23
|
-
if (r < 60 && g > 200 && b > 200)
|
|
24
|
-
return "C";
|
|
25
|
-
if (r > 200 && g < 60 && b > 200)
|
|
26
|
-
return "M";
|
|
27
|
-
if (r > 200 && g > 200 && b < 60)
|
|
28
|
-
return "Y";
|
|
29
|
-
return null;
|
|
30
|
-
}
|
|
31
|
-
function inkChannels(objects) {
|
|
32
|
-
const map = new Map();
|
|
33
|
-
const addColor = (raw) => {
|
|
34
|
-
if (!raw || raw === "transparent")
|
|
35
|
-
return;
|
|
36
|
-
const hex = raw.toLowerCase();
|
|
37
|
-
const cmyk = isCmykPrimary(hex);
|
|
38
|
-
if (cmyk) {
|
|
39
|
-
const swatchMap = {
|
|
40
|
-
C: "#00bcd4",
|
|
41
|
-
M: "#e91e63",
|
|
42
|
-
Y: "#ffeb3b",
|
|
43
|
-
K: "#222",
|
|
44
|
-
};
|
|
45
|
-
const labelMap = {
|
|
46
|
-
C: "Cyan",
|
|
47
|
-
M: "Magenta",
|
|
48
|
-
Y: "Yellow",
|
|
49
|
-
K: "Black",
|
|
50
|
-
};
|
|
51
|
-
const existing = map.get(cmyk);
|
|
52
|
-
if (existing) {
|
|
53
|
-
if (!existing.colors.includes(hex))
|
|
54
|
-
existing.colors.push(hex);
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
map.set(cmyk, {
|
|
58
|
-
key: cmyk,
|
|
59
|
-
label: labelMap[cmyk] ?? cmyk,
|
|
60
|
-
swatch: swatchMap[cmyk] ?? "#000",
|
|
61
|
-
colors: [hex],
|
|
62
|
-
isSpot: false,
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
return;
|
|
66
|
-
}
|
|
67
|
-
// Spot ink — group by source hex
|
|
68
|
-
const existing = map.get(hex);
|
|
69
|
-
if (existing)
|
|
70
|
-
return;
|
|
71
|
-
map.set(hex, {
|
|
72
|
-
key: hex,
|
|
73
|
-
label: `Spot ${hex.toUpperCase()}`,
|
|
74
|
-
swatch: hex,
|
|
75
|
-
colors: [hex],
|
|
76
|
-
isSpot: true,
|
|
77
|
-
});
|
|
78
|
-
};
|
|
79
|
-
for (const o of objects) {
|
|
80
|
-
// Locked, named objects (the dieline) are technical separations:
|
|
81
|
-
// a dedicated named plate from their stroke, not merged with the
|
|
82
|
-
// artwork ink channels.
|
|
83
|
-
if (o.locked && o.name) {
|
|
84
|
-
const raw = o.stroke && o.stroke !== "transparent" ? o.stroke : o.fill;
|
|
85
|
-
const hex = (raw ?? "").toLowerCase();
|
|
86
|
-
if (hex && hex !== "transparent") {
|
|
87
|
-
const key = `tech:${o.name}`;
|
|
88
|
-
if (!map.has(key)) {
|
|
89
|
-
map.set(key, {
|
|
90
|
-
key,
|
|
91
|
-
label: o.name,
|
|
92
|
-
swatch: hex,
|
|
93
|
-
colors: [hex],
|
|
94
|
-
isSpot: false,
|
|
95
|
-
technical: true,
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
continue;
|
|
100
|
-
}
|
|
101
|
-
addColor(o.fill);
|
|
102
|
-
addColor(o.stroke);
|
|
103
|
-
}
|
|
104
|
-
// Deterministic ordering: CMYK first, then spots.
|
|
105
|
-
const order = { C: 0, M: 1, Y: 2, K: 3 };
|
|
106
|
-
return [...map.values()].sort((a, b) => {
|
|
107
|
-
const ai = order[a.key] ?? 100;
|
|
108
|
-
const bi = order[b.key] ?? 100;
|
|
109
|
-
if (ai !== bi)
|
|
110
|
-
return ai - bi;
|
|
111
|
-
return a.label.localeCompare(b.label);
|
|
112
|
-
});
|
|
113
|
-
}
|
|
114
|
-
export function SeparationsPanel({ objects, hidden, onToggle }) {
|
|
115
|
-
const channels = inkChannels(objects);
|
|
116
|
-
return (_jsxs("aside", { style: {
|
|
117
|
-
width: 220,
|
|
118
|
-
background: PANEL,
|
|
119
|
-
borderLeft: `1px solid ${BORDER}`,
|
|
120
|
-
display: "flex",
|
|
121
|
-
flexDirection: "column",
|
|
122
|
-
flexShrink: 0,
|
|
123
|
-
overflow: "hidden",
|
|
124
|
-
}, children: [_jsxs("header", { style: {
|
|
125
|
-
padding: "0.5rem 0.75rem",
|
|
126
|
-
borderBottom: `1px solid ${BORDER}`,
|
|
127
|
-
fontSize: "0.7rem",
|
|
128
|
-
letterSpacing: "0.08em",
|
|
129
|
-
textTransform: "uppercase",
|
|
130
|
-
color: MUTED,
|
|
131
|
-
fontWeight: 600,
|
|
132
|
-
}, children: ["Separations (", channels.length, ")"] }), _jsxs("div", { style: { flex: 1, overflowY: "auto" }, children: [channels.length === 0 && (_jsx("p", { style: { padding: "0.75rem", fontSize: "0.75rem", color: MUTED, margin: 0 }, children: "No ink coverage yet. Set a fill or stroke to populate channels." })), channels.map((ch) => {
|
|
133
|
-
const allHidden = ch.colors.every((c) => hidden.has(c));
|
|
134
|
-
return (_jsxs("label", { style: {
|
|
135
|
-
display: "flex",
|
|
136
|
-
alignItems: "center",
|
|
137
|
-
gap: "0.55rem",
|
|
138
|
-
padding: "0.45rem 0.75rem",
|
|
139
|
-
borderBottom: `1px solid #120a04`,
|
|
140
|
-
cursor: "pointer",
|
|
141
|
-
fontSize: "0.78rem",
|
|
142
|
-
color: allHidden ? MUTED : "#ddd",
|
|
143
|
-
}, children: [_jsx("input", { type: "checkbox", checked: !allHidden, onChange: () => {
|
|
144
|
-
for (const c of ch.colors)
|
|
145
|
-
onToggle(c);
|
|
146
|
-
}, style: { accentColor: "#fc5102" } }), _jsx("span", { "aria-hidden": true, style: {
|
|
147
|
-
display: "inline-block",
|
|
148
|
-
width: 14,
|
|
149
|
-
height: 14,
|
|
150
|
-
borderRadius: 3,
|
|
151
|
-
background: ch.swatch,
|
|
152
|
-
border: ch.swatch === "#222" ? "1px solid #555" : "none",
|
|
153
|
-
} }), _jsx("span", { style: { flex: 1 }, children: ch.label }), (ch.isSpot || ch.technical) && (_jsx("span", { style: {
|
|
154
|
-
fontSize: "0.6rem",
|
|
155
|
-
color: MUTED,
|
|
156
|
-
textTransform: "uppercase",
|
|
157
|
-
letterSpacing: "0.08em",
|
|
158
|
-
}, children: ch.technical ? "Die" : "Spot" }))] }, ch.key));
|
|
159
|
-
})] }), _jsx("p", { style: {
|
|
160
|
-
padding: "0.6rem 0.75rem",
|
|
161
|
-
margin: 0,
|
|
162
|
-
fontSize: "0.65rem",
|
|
163
|
-
color: MUTED,
|
|
164
|
-
borderTop: `1px solid ${BORDER}`,
|
|
165
|
-
lineHeight: 1.4,
|
|
166
|
-
}, children: "Preview only. Final separations are produced by the render service (pdf-writer + Ghostscript ICC)." })] }));
|
|
167
|
-
}
|
|
168
|
-
//# sourceMappingURL=SeparationsPanel.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SeparationsPanel.js","sourceRoot":"","sources":["../../src/components/SeparationsPanel.tsx"],"names":[],"mappings":"AAAA,6CAA6C;AAC7C,YAAY,CAAC;;AASb,MAAM,KAAK,GAAG,SAAS,CAAC;AACxB,MAAM,MAAM,GAAG,SAAS,CAAC;AACzB,MAAM,KAAK,GAAG,MAAM,CAAC;AAoBrB,SAAS,QAAQ,CAAC,GAAW;IAC3B,MAAM,CAAC,GAAG,oBAAoB,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACzC,IAAI,CAAC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