@syntrologie/adapt-nav 2.1.0 → 2.2.0-canary.2
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/dist/NavWidget.d.ts +1 -1
- package/dist/NavWidget.d.ts.map +1 -1
- package/dist/NavWidget.js +6 -8
- package/dist/cdn.d.ts +1 -1
- package/dist/cdn.d.ts.map +1 -1
- package/dist/editor.d.ts.map +1 -1
- package/dist/editor.js +35 -10
- package/dist/runtime.d.ts +1 -1
- package/dist/runtime.d.ts.map +1 -1
- package/dist/schema.d.ts +702 -0
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +33 -0
- package/dist/summarize.d.ts +1 -1
- package/dist/summarize.d.ts.map +1 -1
- package/dist/types.d.ts +5 -15
- package/dist/types.d.ts.map +1 -1
- package/node_modules/@syntro/design-system/README.md +335 -0
- package/node_modules/@syntro/design-system/dist/assets/syntrologie-logo.svg +21 -0
- package/node_modules/@syntro/design-system/dist/assets/syntrologie-logomark.svg +10 -0
- package/node_modules/@syntro/design-system/dist/index.d.ts +8 -0
- package/node_modules/@syntro/design-system/dist/index.d.ts.map +1 -0
- package/node_modules/@syntro/design-system/dist/index.js +7 -0
- package/node_modules/@syntro/design-system/dist/tailwind-preset.d.ts +19 -0
- package/node_modules/@syntro/design-system/dist/tailwind-preset.d.ts.map +1 -0
- package/node_modules/@syntro/design-system/dist/tailwind-preset.js +432 -0
- package/node_modules/@syntro/design-system/dist/tokens/colors.css +464 -0
- package/node_modules/@syntro/design-system/dist/tokens/colors.d.ts +874 -0
- package/node_modules/@syntro/design-system/dist/tokens/colors.d.ts.map +1 -0
- package/node_modules/@syntro/design-system/dist/tokens/colors.js +564 -0
- package/node_modules/@syntro/design-system/dist/tokens/effects.css +43 -0
- package/node_modules/@syntro/design-system/dist/tokens/effects.d.ts +85 -0
- package/node_modules/@syntro/design-system/dist/tokens/effects.d.ts.map +1 -0
- package/node_modules/@syntro/design-system/dist/tokens/effects.js +77 -0
- package/node_modules/@syntro/design-system/dist/tokens/index.d.ts +10 -0
- package/node_modules/@syntro/design-system/dist/tokens/index.d.ts.map +1 -0
- package/node_modules/@syntro/design-system/dist/tokens/index.js +9 -0
- package/node_modules/@syntro/design-system/package.json +55 -0
- package/node_modules/@syntro/design-system/src/assets/syntrologie-logo.svg +21 -0
- package/node_modules/@syntro/design-system/src/assets/syntrologie-logomark.svg +10 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/BeforeAfterToggle.test.d.ts +2 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/BeforeAfterToggle.test.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/BeforeAfterToggle.test.js +28 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/DetectionBadge.test.d.ts +2 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/DetectionBadge.test.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/DetectionBadge.test.js +18 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/DismissedSection.test.d.ts +2 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/DismissedSection.test.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/DismissedSection.test.js +22 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditBackButton.test.d.ts +2 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditBackButton.test.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditBackButton.test.js +20 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorBody.test.d.ts +2 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorBody.test.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorBody.test.js +12 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorCard.test.d.ts +2 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorCard.test.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorCard.test.js +25 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorFooter.test.d.ts +2 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorFooter.test.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorFooter.test.js +23 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorHeader.test.d.ts +2 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorHeader.test.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorHeader.test.js +24 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorInput.test.d.ts +2 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorInput.test.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorInput.test.js +26 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorLayout.test.d.ts +2 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorLayout.test.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorLayout.test.js +13 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorSelect.test.d.ts +2 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorSelect.test.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorSelect.test.js +22 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorTextarea.test.d.ts +2 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorTextarea.test.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EditorTextarea.test.js +20 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/ElementHighlight.test.d.ts +2 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/ElementHighlight.test.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/ElementHighlight.test.js +100 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EmptyState.test.d.ts +2 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EmptyState.test.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/EmptyState.test.js +10 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/GroupHeader.test.d.ts +2 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/GroupHeader.test.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/GroupHeader.test.js +14 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/TriggerJourney.test.d.ts +2 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/TriggerJourney.test.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/TriggerJourney.test.js +126 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/cn.test.d.ts +2 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/cn.test.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/cn.test.js +16 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/formatConditionLabel.test.d.ts +2 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/formatConditionLabel.test.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/formatConditionLabel.test.js +329 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/useElementRect.test.d.ts +2 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/useElementRect.test.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/__tests__/useElementRect.test.js +112 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/cn.d.ts +2 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/cn.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/cn.js +3 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/AnchorPicker.d.ts +31 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/AnchorPicker.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/AnchorPicker.js +152 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/BeforeAfterToggle.d.ts +7 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/BeforeAfterToggle.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/BeforeAfterToggle.js +9 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/ConditionStatusLine.d.ts +23 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/ConditionStatusLine.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/ConditionStatusLine.js +40 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/DetectionBadge.d.ts +6 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/DetectionBadge.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/DetectionBadge.js +5 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/DismissedSection.d.ts +8 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/DismissedSection.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/DismissedSection.js +9 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditBackButton.d.ts +7 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditBackButton.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditBackButton.js +4 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorBody.d.ts +7 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorBody.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorBody.js +4 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorCard.d.ts +13 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorCard.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorCard.js +6 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorFooter.d.ts +7 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorFooter.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorFooter.js +4 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorHeader.d.ts +9 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorHeader.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorHeader.js +4 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorInput.d.ts +8 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorInput.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorInput.js +5 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorLayout.d.ts +7 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorLayout.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorLayout.js +4 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorPanelShell.d.ts +23 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorPanelShell.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorPanelShell.js +116 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorSelect.d.ts +8 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorSelect.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorSelect.js +5 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorTextarea.d.ts +8 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorTextarea.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorTextarea.js +15 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/ElementHighlight.d.ts +32 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/ElementHighlight.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/ElementHighlight.js +75 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EmptyState.d.ts +6 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EmptyState.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EmptyState.js +4 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/GroupHeader.d.ts +8 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/GroupHeader.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/GroupHeader.js +5 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/TriggerJourney.d.ts +12 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/TriggerJourney.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/TriggerJourney.js +40 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/formatConditionLabel.d.ts +26 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/formatConditionLabel.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/formatConditionLabel.js +207 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useElementRect.d.ts +8 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useElementRect.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useElementRect.js +46 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useShowWhenStatus.d.ts +24 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useShowWhenStatus.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/hooks/useShowWhenStatus.js +215 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/index.d.ts +33 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/index.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/index.js +24 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/utils/selectorGenerator.d.ts +22 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/utils/selectorGenerator.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/utils/selectorGenerator.js +143 -0
- package/node_modules/@syntrologie/shared-editor-ui/package.json +45 -0
- package/package.json +15 -10
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
import { act, renderHook } from '@testing-library/react';
|
|
2
|
+
import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
|
|
3
|
+
import { useElementRect } from '../hooks/useElementRect';
|
|
4
|
+
// Mock ResizeObserver for jsdom
|
|
5
|
+
class MockResizeObserver {
|
|
6
|
+
constructor(cb) {
|
|
7
|
+
this.callback = cb;
|
|
8
|
+
}
|
|
9
|
+
observe() { }
|
|
10
|
+
unobserve() { }
|
|
11
|
+
disconnect() { }
|
|
12
|
+
}
|
|
13
|
+
// Mock requestAnimationFrame to execute synchronously in tests
|
|
14
|
+
vi.stubGlobal('ResizeObserver', MockResizeObserver);
|
|
15
|
+
vi.stubGlobal('requestAnimationFrame', (cb) => {
|
|
16
|
+
cb(0);
|
|
17
|
+
return 0;
|
|
18
|
+
});
|
|
19
|
+
vi.stubGlobal('cancelAnimationFrame', () => { });
|
|
20
|
+
describe('useElementRect', () => {
|
|
21
|
+
let mockElement;
|
|
22
|
+
let mockRect;
|
|
23
|
+
beforeEach(() => {
|
|
24
|
+
mockRect = {
|
|
25
|
+
top: 100,
|
|
26
|
+
left: 200,
|
|
27
|
+
width: 300,
|
|
28
|
+
height: 150,
|
|
29
|
+
bottom: 250,
|
|
30
|
+
right: 500,
|
|
31
|
+
x: 200,
|
|
32
|
+
y: 100,
|
|
33
|
+
toJSON: () => ({}),
|
|
34
|
+
};
|
|
35
|
+
mockElement = document.createElement('div');
|
|
36
|
+
vi.spyOn(mockElement, 'getBoundingClientRect').mockReturnValue(mockRect);
|
|
37
|
+
});
|
|
38
|
+
afterEach(() => {
|
|
39
|
+
vi.restoreAllMocks();
|
|
40
|
+
});
|
|
41
|
+
it('returns null when element is null', () => {
|
|
42
|
+
const { result } = renderHook(() => useElementRect(null));
|
|
43
|
+
expect(result.current).toBeNull();
|
|
44
|
+
});
|
|
45
|
+
it('returns rect when element is provided', () => {
|
|
46
|
+
const { result } = renderHook(() => useElementRect(mockElement));
|
|
47
|
+
expect(result.current).not.toBeNull();
|
|
48
|
+
expect(result.current.top).toBe(100);
|
|
49
|
+
expect(result.current.left).toBe(200);
|
|
50
|
+
expect(result.current.width).toBe(300);
|
|
51
|
+
expect(result.current.height).toBe(150);
|
|
52
|
+
});
|
|
53
|
+
it('updates rect on scroll event', () => {
|
|
54
|
+
const { result } = renderHook(() => useElementRect(mockElement));
|
|
55
|
+
// Change mock rect to simulate scroll
|
|
56
|
+
const scrolledRect = {
|
|
57
|
+
...mockRect,
|
|
58
|
+
top: 50,
|
|
59
|
+
y: 50,
|
|
60
|
+
bottom: 200,
|
|
61
|
+
toJSON: () => ({}),
|
|
62
|
+
};
|
|
63
|
+
vi.spyOn(mockElement, 'getBoundingClientRect').mockReturnValue(scrolledRect);
|
|
64
|
+
act(() => {
|
|
65
|
+
window.dispatchEvent(new Event('scroll'));
|
|
66
|
+
});
|
|
67
|
+
expect(result.current.top).toBe(50);
|
|
68
|
+
});
|
|
69
|
+
it('updates rect on resize event', () => {
|
|
70
|
+
const { result } = renderHook(() => useElementRect(mockElement));
|
|
71
|
+
const resizedRect = {
|
|
72
|
+
...mockRect,
|
|
73
|
+
width: 500,
|
|
74
|
+
right: 700,
|
|
75
|
+
toJSON: () => ({}),
|
|
76
|
+
};
|
|
77
|
+
vi.spyOn(mockElement, 'getBoundingClientRect').mockReturnValue(resizedRect);
|
|
78
|
+
act(() => {
|
|
79
|
+
window.dispatchEvent(new Event('resize'));
|
|
80
|
+
});
|
|
81
|
+
expect(result.current.width).toBe(500);
|
|
82
|
+
});
|
|
83
|
+
it('resets to null when element changes to null', () => {
|
|
84
|
+
const { result, rerender } = renderHook(({ el }) => useElementRect(el), {
|
|
85
|
+
initialProps: { el: mockElement },
|
|
86
|
+
});
|
|
87
|
+
expect(result.current).not.toBeNull();
|
|
88
|
+
rerender({ el: null });
|
|
89
|
+
expect(result.current).toBeNull();
|
|
90
|
+
});
|
|
91
|
+
it('updates rect when element changes', () => {
|
|
92
|
+
const secondElement = document.createElement('span');
|
|
93
|
+
const secondRect = {
|
|
94
|
+
top: 400,
|
|
95
|
+
left: 500,
|
|
96
|
+
width: 100,
|
|
97
|
+
height: 50,
|
|
98
|
+
bottom: 450,
|
|
99
|
+
right: 600,
|
|
100
|
+
x: 500,
|
|
101
|
+
y: 400,
|
|
102
|
+
toJSON: () => ({}),
|
|
103
|
+
};
|
|
104
|
+
vi.spyOn(secondElement, 'getBoundingClientRect').mockReturnValue(secondRect);
|
|
105
|
+
const { result, rerender } = renderHook(({ el }) => useElementRect(el), {
|
|
106
|
+
initialProps: { el: mockElement },
|
|
107
|
+
});
|
|
108
|
+
expect(result.current.top).toBe(100);
|
|
109
|
+
rerender({ el: secondElement });
|
|
110
|
+
expect(result.current.top).toBe(400);
|
|
111
|
+
});
|
|
112
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cn.d.ts","sourceRoot":"","sources":["../src/cn.ts"],"names":[],"mappings":"AAAA,wBAAgB,EAAE,CAAC,GAAG,OAAO,EAAE,CAAC,MAAM,GAAG,KAAK,GAAG,IAAI,GAAG,SAAS,CAAC,EAAE,GAAG,MAAM,CAE5E"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AnchorPicker — Shared Element Picker Overlay
|
|
3
|
+
*
|
|
4
|
+
* Full-page overlay that lets the user hover and click to select a DOM element.
|
|
5
|
+
* Returns the element, its CSS selector, and a human-readable description.
|
|
6
|
+
*
|
|
7
|
+
* Renders via createPortal to document.body. Uses inline styles (not Tailwind)
|
|
8
|
+
* because it lives outside the editor's style scope.
|
|
9
|
+
*
|
|
10
|
+
* EXCEPTION: This component MUST stay on document.body (not in shadow root).
|
|
11
|
+
* It uses document.elementFromPoint() to detect host page elements under the
|
|
12
|
+
* cursor. If placed inside a shadow root, the overlay would block detection
|
|
13
|
+
* of underlying host elements.
|
|
14
|
+
*
|
|
15
|
+
* Instructions / cancel UI should be rendered by the consumer in their own
|
|
16
|
+
* panel — this component only provides the page overlay.
|
|
17
|
+
*/
|
|
18
|
+
import React from 'react';
|
|
19
|
+
export interface PickedElement {
|
|
20
|
+
element: Element;
|
|
21
|
+
selector: string;
|
|
22
|
+
description: string;
|
|
23
|
+
}
|
|
24
|
+
export interface AnchorPickerProps {
|
|
25
|
+
isActive: boolean;
|
|
26
|
+
onPick: (picked: PickedElement) => void;
|
|
27
|
+
onCancel: () => void;
|
|
28
|
+
excludeSelector?: string;
|
|
29
|
+
}
|
|
30
|
+
export declare function AnchorPicker({ isActive, onPick, onCancel, excludeSelector, }: AnchorPickerProps): React.ReactPortal | null;
|
|
31
|
+
//# sourceMappingURL=AnchorPicker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnchorPicker.d.ts","sourceRoot":"","sources":["../../src/components/AnchorPicker.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,KAAmD,MAAM,OAAO,CAAC;AASxE,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,iBAAiB;IAChC,QAAQ,EAAE,OAAO,CAAC;IAClB,MAAM,EAAE,CAAC,MAAM,EAAE,aAAa,KAAK,IAAI,CAAC;IACxC,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAKD,wBAAgB,YAAY,CAAC,EAC3B,QAAQ,EACR,MAAM,EACN,QAAQ,EACR,eAAuJ,GACxJ,EAAE,iBAAiB,4BAgMnB"}
|
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* AnchorPicker — Shared Element Picker Overlay
|
|
4
|
+
*
|
|
5
|
+
* Full-page overlay that lets the user hover and click to select a DOM element.
|
|
6
|
+
* Returns the element, its CSS selector, and a human-readable description.
|
|
7
|
+
*
|
|
8
|
+
* Renders via createPortal to document.body. Uses inline styles (not Tailwind)
|
|
9
|
+
* because it lives outside the editor's style scope.
|
|
10
|
+
*
|
|
11
|
+
* EXCEPTION: This component MUST stay on document.body (not in shadow root).
|
|
12
|
+
* It uses document.elementFromPoint() to detect host page elements under the
|
|
13
|
+
* cursor. If placed inside a shadow root, the overlay would block detection
|
|
14
|
+
* of underlying host elements.
|
|
15
|
+
*
|
|
16
|
+
* Instructions / cancel UI should be rendered by the consumer in their own
|
|
17
|
+
* panel — this component only provides the page overlay.
|
|
18
|
+
*/
|
|
19
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
20
|
+
import { createPortal } from 'react-dom';
|
|
21
|
+
import { generateSelector, getElementDescription, validateSelector, } from '../utils/selectorGenerator';
|
|
22
|
+
const HIGHLIGHT_COLOR = '#3b82f6';
|
|
23
|
+
const HIGHLIGHT_BG = 'rgba(59, 130, 246, 0.1)';
|
|
24
|
+
export function AnchorPicker({ isActive, onPick, onCancel, excludeSelector = '[data-syntro-editor-panel], [data-shadow-canvas-id], .syntro-tooltip, .syntro-modal, .syntro-highlight, [data-syntro-anchor-picker]', }) {
|
|
25
|
+
const [hoveredElement, setHoveredElement] = useState(null);
|
|
26
|
+
const [hoveredSelector, setHoveredSelector] = useState('');
|
|
27
|
+
const overlayRef = useRef(null);
|
|
28
|
+
const handleMouseMove = useCallback((e) => {
|
|
29
|
+
const overlay = overlayRef.current;
|
|
30
|
+
if (overlay) {
|
|
31
|
+
overlay.style.pointerEvents = 'none';
|
|
32
|
+
}
|
|
33
|
+
const elementAtPoint = document.elementFromPoint(e.clientX, e.clientY);
|
|
34
|
+
if (overlay) {
|
|
35
|
+
overlay.style.pointerEvents = 'auto';
|
|
36
|
+
}
|
|
37
|
+
if (!elementAtPoint) {
|
|
38
|
+
setHoveredElement(null);
|
|
39
|
+
setHoveredSelector('');
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
if (excludeSelector && elementAtPoint.closest(excludeSelector)) {
|
|
43
|
+
setHoveredElement(null);
|
|
44
|
+
setHoveredSelector('');
|
|
45
|
+
return;
|
|
46
|
+
}
|
|
47
|
+
if (['HTML', 'BODY', 'HEAD'].includes(elementAtPoint.tagName)) {
|
|
48
|
+
setHoveredElement(null);
|
|
49
|
+
setHoveredSelector('');
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
setHoveredElement(elementAtPoint);
|
|
53
|
+
const selector = generateSelector(elementAtPoint);
|
|
54
|
+
setHoveredSelector(selector);
|
|
55
|
+
}, [excludeSelector]);
|
|
56
|
+
const handleClick = useCallback((e) => {
|
|
57
|
+
e.preventDefault();
|
|
58
|
+
e.stopPropagation();
|
|
59
|
+
if (hoveredElement && hoveredSelector) {
|
|
60
|
+
if (validateSelector(hoveredSelector, hoveredElement)) {
|
|
61
|
+
onPick({
|
|
62
|
+
element: hoveredElement,
|
|
63
|
+
selector: hoveredSelector,
|
|
64
|
+
description: getElementDescription(hoveredElement),
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
else {
|
|
68
|
+
const newSelector = generateSelector(hoveredElement);
|
|
69
|
+
onPick({
|
|
70
|
+
element: hoveredElement,
|
|
71
|
+
selector: newSelector,
|
|
72
|
+
description: getElementDescription(hoveredElement),
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}, [hoveredElement, hoveredSelector, onPick]);
|
|
77
|
+
const handleKeyDown = useCallback((e) => {
|
|
78
|
+
if (e.key === 'Escape') {
|
|
79
|
+
e.preventDefault();
|
|
80
|
+
onCancel();
|
|
81
|
+
}
|
|
82
|
+
}, [onCancel]);
|
|
83
|
+
useEffect(() => {
|
|
84
|
+
if (!isActive)
|
|
85
|
+
return;
|
|
86
|
+
document.addEventListener('mousemove', handleMouseMove, true);
|
|
87
|
+
document.addEventListener('click', handleClick, true);
|
|
88
|
+
document.addEventListener('keydown', handleKeyDown, true);
|
|
89
|
+
return () => {
|
|
90
|
+
document.removeEventListener('mousemove', handleMouseMove, true);
|
|
91
|
+
document.removeEventListener('click', handleClick, true);
|
|
92
|
+
document.removeEventListener('keydown', handleKeyDown, true);
|
|
93
|
+
};
|
|
94
|
+
}, [isActive, handleMouseMove, handleClick, handleKeyDown]);
|
|
95
|
+
if (!isActive)
|
|
96
|
+
return null;
|
|
97
|
+
const rect = hoveredElement?.getBoundingClientRect();
|
|
98
|
+
return createPortal(_jsxs("div", { ref: overlayRef, "data-syntro-anchor-picker": true, style: {
|
|
99
|
+
position: 'fixed',
|
|
100
|
+
inset: 0,
|
|
101
|
+
cursor: 'crosshair',
|
|
102
|
+
zIndex: 2147483647,
|
|
103
|
+
}, children: [_jsx("div", { style: {
|
|
104
|
+
position: 'absolute',
|
|
105
|
+
inset: 0,
|
|
106
|
+
background: 'rgba(0, 0, 0, 0.05)',
|
|
107
|
+
pointerEvents: 'none',
|
|
108
|
+
} }), hoveredElement && rect && (_jsx("div", { style: {
|
|
109
|
+
position: 'fixed',
|
|
110
|
+
left: rect.left - 2,
|
|
111
|
+
top: rect.top - 2,
|
|
112
|
+
width: rect.width + 4,
|
|
113
|
+
height: rect.height + 4,
|
|
114
|
+
border: `2px solid ${HIGHLIGHT_COLOR}`,
|
|
115
|
+
backgroundColor: HIGHLIGHT_BG,
|
|
116
|
+
borderRadius: '4px',
|
|
117
|
+
boxShadow: '0 0 0 9999px rgba(0, 0, 0, 0.15)',
|
|
118
|
+
pointerEvents: 'none',
|
|
119
|
+
transition: 'all 0.1s ease-out',
|
|
120
|
+
} })), hoveredElement && rect && (_jsxs("div", { style: {
|
|
121
|
+
position: 'fixed',
|
|
122
|
+
left: Math.max(8, Math.min(rect.left, window.innerWidth - 320)),
|
|
123
|
+
top: Math.max(8, rect.top - 68),
|
|
124
|
+
backgroundColor: '#1e293b',
|
|
125
|
+
color: '#e2e8f0',
|
|
126
|
+
padding: '8px 12px',
|
|
127
|
+
borderRadius: '6px',
|
|
128
|
+
boxShadow: '0 4px 12px rgba(0, 0, 0, 0.3)',
|
|
129
|
+
zIndex: 1,
|
|
130
|
+
fontFamily: 'monospace',
|
|
131
|
+
fontSize: '12px',
|
|
132
|
+
maxWidth: '300px',
|
|
133
|
+
pointerEvents: 'none',
|
|
134
|
+
}, children: [_jsx("div", { style: {
|
|
135
|
+
fontSize: '11px',
|
|
136
|
+
textTransform: 'uppercase',
|
|
137
|
+
letterSpacing: '0.05em',
|
|
138
|
+
marginBottom: '4px',
|
|
139
|
+
color: '#94a3b8',
|
|
140
|
+
}, children: "Click to select" }), _jsx("div", { style: {
|
|
141
|
+
color: '#38bdf8',
|
|
142
|
+
overflow: 'hidden',
|
|
143
|
+
textOverflow: 'ellipsis',
|
|
144
|
+
whiteSpace: 'nowrap',
|
|
145
|
+
}, children: hoveredSelector }), _jsx("div", { style: {
|
|
146
|
+
marginTop: '4px',
|
|
147
|
+
color: '#cbd5e1',
|
|
148
|
+
overflow: 'hidden',
|
|
149
|
+
textOverflow: 'ellipsis',
|
|
150
|
+
whiteSpace: 'nowrap',
|
|
151
|
+
}, children: getElementDescription(hoveredElement) })] }))] }), document.body);
|
|
152
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
interface BeforeAfterToggleProps {
|
|
2
|
+
mode: 'before' | 'after';
|
|
3
|
+
onToggle: (mode: 'before' | 'after') => void;
|
|
4
|
+
}
|
|
5
|
+
export declare function BeforeAfterToggle({ mode, onToggle }: BeforeAfterToggleProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=BeforeAfterToggle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BeforeAfterToggle.d.ts","sourceRoot":"","sources":["../../src/components/BeforeAfterToggle.tsx"],"names":[],"mappings":"AAEA,UAAU,sBAAsB;IAC9B,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAC;IACzB,QAAQ,EAAE,CAAC,IAAI,EAAE,QAAQ,GAAG,OAAO,KAAK,IAAI,CAAC;CAC9C;AAED,wBAAgB,iBAAiB,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,sBAAsB,2CA2B3E"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from '../cn';
|
|
3
|
+
export function BeforeAfterToggle({ mode, onToggle }) {
|
|
4
|
+
return (_jsxs("div", { className: "se-flex se-mb-3 se-rounded-lg se-overflow-hidden se-border se-border-border-primary", children: [_jsx("button", { onClick: () => onToggle('before'), className: cn('se-flex-1 se-py-1.5 se-px-3 se-border-none se-text-sm se-font-semibold se-cursor-pointer focus-visible:se-shadow-focus-primary focus-visible:se-outline-none', mode === 'before'
|
|
5
|
+
? 'se-bg-blue-5/20 se-text-blue-5'
|
|
6
|
+
: 'se-bg-transparent se-text-text-secondary'), children: "Before" }), _jsx("button", { onClick: () => onToggle('after'), className: cn('se-flex-1 se-py-1.5 se-px-3 se-border-none se-border-l se-border-border-primary se-text-sm se-font-semibold se-cursor-pointer focus-visible:se-shadow-focus-primary focus-visible:se-outline-none', mode === 'after'
|
|
7
|
+
? 'se-bg-blue-5/20 se-text-blue-5'
|
|
8
|
+
: 'se-bg-transparent se-text-text-secondary'), children: "After" })] }));
|
|
9
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ConditionStatusLine — inline showWhen diagnostic on EditorCard.
|
|
3
|
+
*
|
|
4
|
+
* Shows a compact one-line status for items with showWhen conditions.
|
|
5
|
+
* Click to expand per-condition detail.
|
|
6
|
+
*/
|
|
7
|
+
import type { FormattedCondition } from '../formatConditionLabel';
|
|
8
|
+
export interface ConditionStatus {
|
|
9
|
+
type: string;
|
|
10
|
+
passed: boolean;
|
|
11
|
+
formatted: FormattedCondition;
|
|
12
|
+
}
|
|
13
|
+
export interface ShowWhenStatus {
|
|
14
|
+
visible: boolean;
|
|
15
|
+
isFallback: boolean;
|
|
16
|
+
conditions: ConditionStatus[];
|
|
17
|
+
}
|
|
18
|
+
interface ConditionStatusLineProps {
|
|
19
|
+
status: ShowWhenStatus | null;
|
|
20
|
+
}
|
|
21
|
+
export declare function ConditionStatusLine({ status }: ConditionStatusLineProps): import("react/jsx-runtime").JSX.Element | null;
|
|
22
|
+
export {};
|
|
23
|
+
//# sourceMappingURL=ConditionStatusLine.d.ts.map
|
package/node_modules/@syntrologie/shared-editor-ui/dist/components/ConditionStatusLine.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConditionStatusLine.d.ts","sourceRoot":"","sources":["../../src/components/ConditionStatusLine.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAKH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,OAAO,CAAC;IAChB,SAAS,EAAE,kBAAkB,CAAC;CAC/B;AAED,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,eAAe,EAAE,CAAC;CAC/B;AAED,UAAU,wBAAwB;IAChC,MAAM,EAAE,cAAc,GAAG,IAAI,CAAC;CAC/B;AA6CD,wBAAgB,mBAAmB,CAAC,EAAE,MAAM,EAAE,EAAE,wBAAwB,kDAiEvE"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* ConditionStatusLine — inline showWhen diagnostic on EditorCard.
|
|
4
|
+
*
|
|
5
|
+
* Shows a compact one-line status for items with showWhen conditions.
|
|
6
|
+
* Click to expand per-condition detail.
|
|
7
|
+
*/
|
|
8
|
+
import { Check, Clock, X } from 'lucide-react';
|
|
9
|
+
import { useState } from 'react';
|
|
10
|
+
import { cn } from '../cn';
|
|
11
|
+
function ProgressBar({ current, target }) {
|
|
12
|
+
const pct = Math.min(100, Math.round((current / Math.max(target, 1)) * 100));
|
|
13
|
+
return (_jsx("span", { className: "se-inline-block se-w-12 se-h-1.5 se-rounded-full se-bg-white/10 se-align-middle se-ml-1", title: `${current}/${target} (${pct}%)`, children: _jsx("span", { className: cn('se-block se-h-full se-rounded-full se-transition-all', pct >= 100 ? 'se-bg-green-4' : 'se-bg-blue-4'), style: { width: `${pct}%` } }) }));
|
|
14
|
+
}
|
|
15
|
+
function ConditionRow({ cs }) {
|
|
16
|
+
return (_jsxs("div", { className: "se-flex se-items-center se-gap-1 se-pl-3 se-text-[10px] se-text-text-secondary", children: [cs.passed ? (_jsx(Check, { className: "se-w-3 se-h-3 se-text-green-4" })) : (_jsx(X, { className: "se-w-3 se-h-3 se-text-red-4" })), _jsxs("span", { children: [cs.type, ":"] }), _jsx("span", { className: "se-text-text-tertiary", children: cs.formatted.label }), cs.formatted.progress && (_jsxs(_Fragment, { children: [_jsx(ProgressBar, { current: cs.formatted.progress.current, target: cs.formatted.progress.target }), _jsxs("span", { className: "se-text-text-tertiary se-ml-0.5", children: [cs.formatted.progress.current, "/", cs.formatted.progress.target] })] }))] }));
|
|
17
|
+
}
|
|
18
|
+
export function ConditionStatusLine({ status }) {
|
|
19
|
+
const [expanded, setExpanded] = useState(false);
|
|
20
|
+
if (!status)
|
|
21
|
+
return null;
|
|
22
|
+
const { visible, conditions } = status;
|
|
23
|
+
const passedCount = conditions.filter((c) => c.passed).length;
|
|
24
|
+
const totalCount = conditions.length;
|
|
25
|
+
// Icon: visible = green check, hidden = clock
|
|
26
|
+
const StatusIcon = visible ? Check : Clock;
|
|
27
|
+
const iconColor = visible ? 'se-text-green-4' : 'se-text-yellow-5';
|
|
28
|
+
// Single condition: show inline detail
|
|
29
|
+
// Multi condition: show summary, click to expand
|
|
30
|
+
const isSingle = totalCount === 1;
|
|
31
|
+
if (isSingle) {
|
|
32
|
+
const cs = conditions[0];
|
|
33
|
+
return (_jsxs("div", { className: "se-text-[10px] se-text-text-secondary se-mt-0.5 se-flex se-items-center se-gap-1", children: [_jsx(StatusIcon, { className: cn('se-w-3 se-h-3', iconColor) }), _jsxs("span", { children: [cs.type, ":"] }), _jsx("span", { className: "se-text-text-tertiary", children: cs.formatted.label }), cs.formatted.progress && (_jsxs(_Fragment, { children: [_jsx(ProgressBar, { current: cs.formatted.progress.current, target: cs.formatted.progress.target }), _jsxs("span", { className: "se-text-text-tertiary se-ml-0.5", children: [cs.formatted.progress.current, "/", cs.formatted.progress.target] })] }))] }));
|
|
34
|
+
}
|
|
35
|
+
// Multi-condition: summary line + expandable detail
|
|
36
|
+
return (_jsxs("div", { className: "se-mt-0.5", children: [_jsxs("button", { type: "button", className: "se-flex se-items-center se-gap-1 se-text-[10px] se-text-text-secondary se-bg-transparent se-border-none se-cursor-pointer se-p-0 hover:se-text-text-primary", onClick: (e) => {
|
|
37
|
+
e.stopPropagation();
|
|
38
|
+
setExpanded(!expanded);
|
|
39
|
+
}, children: [_jsx(StatusIcon, { className: cn('se-w-3 se-h-3', iconColor) }), _jsxs("span", { children: [passedCount, " of ", totalCount, " conditions met"] }), _jsx("span", { className: "se-text-[8px] se-ml-0.5", children: expanded ? '\u25b2' : '\u25bc' })] }), expanded && (_jsx("div", { className: "se-mt-0.5 se-space-y-0.5", children: conditions.map((cs, i) => (_jsx(ConditionRow, { cs: cs }, i))) }))] }));
|
|
40
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DetectionBadge.d.ts","sourceRoot":"","sources":["../../src/components/DetectionBadge.tsx"],"names":[],"mappings":"AAEA,UAAU,mBAAmB;IAC3B,KAAK,EAAE,OAAO,CAAC;CAChB;AAED,wBAAgB,cAAc,CAAC,EAAE,KAAK,EAAE,EAAE,mBAAmB,2CAU5D"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from '../cn';
|
|
3
|
+
export function DetectionBadge({ found }) {
|
|
4
|
+
return (_jsx("span", { className: cn('se-w-2 se-h-2 se-rounded-full se-shrink-0 se-inline-block', found ? 'se-bg-green-4' : 'se-bg-text-tertiary'), title: found ? 'Found on this page' : 'Not found on this page' }));
|
|
5
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
interface DismissedSectionProps {
|
|
3
|
+
count: number;
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
}
|
|
6
|
+
export declare function DismissedSection({ count, children }: DismissedSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=DismissedSection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DismissedSection.d.ts","sourceRoot":"","sources":["../../src/components/DismissedSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAG/B,UAAU,qBAAqB;IAC7B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,wBAAgB,gBAAgB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,qBAAqB,2CAqB1E"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
3
|
+
export function DismissedSection({ count, children }) {
|
|
4
|
+
const [isOpen, setIsOpen] = useState(false);
|
|
5
|
+
return (_jsxs("div", { className: "se-mt-4 se-cursor-pointer se-select-none", children: [_jsxs("div", { role: "button", tabIndex: 0, className: "se-text-xs se-font-semibold se-text-text-tertiary se-flex se-items-center se-gap-1.5 se-cursor-pointer", onClick: () => setIsOpen(!isOpen), onKeyDown: (e) => {
|
|
6
|
+
if (e.key === 'Enter' || e.key === ' ')
|
|
7
|
+
setIsOpen(!isOpen);
|
|
8
|
+
}, children: [_jsx("span", { children: isOpen ? '\u25be' : '\u25b8' }), _jsxs("span", { children: ["Dismissed (", count, ")"] })] }), isOpen && _jsx("div", { className: "se-mt-1.5", children: children })] }));
|
|
9
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditBackButton.d.ts","sourceRoot":"","sources":["../../src/components/EditBackButton.tsx"],"names":[],"mappings":"AAAA,UAAU,mBAAmB;IAC3B,OAAO,EAAE,MAAM,IAAI,CAAC;IACpB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,wBAAgB,cAAc,CAAC,EAAE,OAAO,EAAE,KAAqB,EAAE,EAAE,mBAAmB,2CASrF"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
export function EditBackButton({ onClick, label = '\u2190 List' }) {
|
|
3
|
+
return (_jsx("button", { onClick: onClick, className: "se-h-10 se-px-4 se-py-2 se-rounded-md se-bg-btn-neutral se-text-btn-neutral-text se-border se-border-btn-neutral-border hover:se-text-btn-neutral-text-hover se-text-sm se-font-medium se-cursor-pointer se-mt-2 se-inline-flex se-items-center se-justify-center focus-visible:se-shadow-focus-primary focus-visible:se-outline-none", children: label }));
|
|
4
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditorBody.d.ts","sourceRoot":"","sources":["../../src/components/EditorBody.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,UAAU,eAAe;IACvB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,wBAAgB,UAAU,CAAC,EAAE,QAAQ,EAAE,EAAE,eAAe,2CAEvD"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
interface EditorCardProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
itemKey: string;
|
|
5
|
+
onClick?: () => void;
|
|
6
|
+
onMouseEnter?: () => void;
|
|
7
|
+
onMouseLeave?: () => void;
|
|
8
|
+
className?: string;
|
|
9
|
+
validated?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function EditorCard({ children, itemKey, onClick, onMouseEnter, onMouseLeave, className, validated, }: EditorCardProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export {};
|
|
13
|
+
//# sourceMappingURL=EditorCard.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditorCard.d.ts","sourceRoot":"","sources":["../../src/components/EditorCard.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,UAAU,eAAe;IACvB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;IACrB,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,YAAY,CAAC,EAAE,MAAM,IAAI,CAAC;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED,wBAAgB,UAAU,CAAC,EACzB,QAAQ,EACR,OAAO,EACP,OAAO,EACP,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,SAAS,GACV,EAAE,eAAe,2CAkBjB"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from '../cn';
|
|
3
|
+
export function EditorCard({ children, itemKey, onClick, onMouseEnter, onMouseLeave, className, validated, }) {
|
|
4
|
+
return (_jsx("div", { "data-item-key": itemKey, onClick: onClick, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, className: cn('se-py-2 se-px-2.5 se-rounded-lg se-border se-bg-card-bg se-shadow-sm se-mb-1 se-text-sm se-text-text-primary', validated ? 'se-border-green-4/40 se-shadow-glow-green' : 'se-border-border-primary', onClick &&
|
|
5
|
+
'se-cursor-pointer hover:se-border-border-primary/80 hover:se-bg-sidebar-hover se-transition-colors', className), children: children }));
|
|
6
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditorFooter.d.ts","sourceRoot":"","sources":["../../src/components/EditorFooter.tsx"],"names":[],"mappings":"AAAA,UAAU,iBAAiB;IACzB,MAAM,EAAE,MAAM,IAAI,CAAC;IACnB,SAAS,EAAE,MAAM,IAAI,CAAC;CACvB;AAED,wBAAgB,YAAY,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,iBAAiB,2CAiBpE"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
export function EditorFooter({ onSave, onPublish }) {
|
|
3
|
+
return (_jsxs("div", { className: "se-py-3 se-px-4 se-border-t se-border-border-primary se-flex se-gap-2", children: [_jsx("button", { onClick: onSave, className: "se-flex-1 se-h-10 se-px-4 se-py-2 se-rounded-md se-bg-btn-neutral se-text-btn-neutral-text se-border se-border-btn-neutral-border hover:se-text-btn-neutral-text-hover se-text-sm se-font-medium se-cursor-pointer se-inline-flex se-items-center se-justify-center focus-visible:se-shadow-focus-primary focus-visible:se-outline-none", children: "Save Draft" }), _jsx("button", { onClick: onPublish, className: "se-flex-1 se-h-10 se-px-4 se-py-2 se-rounded-md se-border-none se-bg-btn-primary se-text-btn-primary-text hover:se-bg-btn-primary-hover se-text-sm se-font-medium se-cursor-pointer se-inline-flex se-items-center se-justify-center focus-visible:se-shadow-focus-primary focus-visible:se-outline-none", children: "Publish" })] }));
|
|
4
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
interface EditorHeaderProps {
|
|
2
|
+
title: string;
|
|
3
|
+
subtitle?: string;
|
|
4
|
+
/** @deprecated Back navigation is now handled at the panel level. */
|
|
5
|
+
onBack?: () => void;
|
|
6
|
+
}
|
|
7
|
+
export declare function EditorHeader({ title, subtitle }: EditorHeaderProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=EditorHeader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditorHeader.d.ts","sourceRoot":"","sources":["../../src/components/EditorHeader.tsx"],"names":[],"mappings":"AAAA,UAAU,iBAAiB;IACzB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qEAAqE;IACrE,MAAM,CAAC,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,wBAAgB,YAAY,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,EAAE,iBAAiB,2CASlE"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
export function EditorHeader({ title, subtitle }) {
|
|
3
|
+
return (_jsxs("div", { className: "se-px-4 se-pt-3 se-pb-2", children: [_jsx("h2", { className: "se-m-0 se-text-base se-font-semibold se-text-text-primary", children: title }), subtitle && (_jsx("p", { className: "se-mt-0.5 se-mb-0 se-text-xs se-text-text-secondary", children: subtitle }))] }));
|
|
4
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
interface EditorInputProps extends React.InputHTMLAttributes<HTMLInputElement> {
|
|
3
|
+
label?: string;
|
|
4
|
+
className?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function EditorInput({ label, className, ...props }: EditorInputProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=EditorInput.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditorInput.d.ts","sourceRoot":"","sources":["../../src/components/EditorInput.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAI/B,UAAU,gBAAiB,SAAQ,KAAK,CAAC,mBAAmB,CAAC,gBAAgB,CAAC;IAC5E,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,WAAW,CAAC,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,KAAK,EAAE,EAAE,gBAAgB,2CAoB3E"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { cn } from '../cn';
|
|
3
|
+
export function EditorInput({ label, className, ...props }) {
|
|
4
|
+
return (_jsxs("div", { children: [label && (_jsx("label", { className: "se-text-sm se-font-medium se-text-input-field-text-label se-mb-1 se-block", children: label })), _jsx("input", { ...props, className: cn('se-w-full se-py-2 se-px-3 se-rounded-lg se-border se-border-input-field-border se-bg-slate-grey-3 se-text-text-primary se-text-sm se-font-[inherit] se-mb-2 se-box-border', 'placeholder:se-text-input-field-text-placeholder', 'focus:se-border-input-field-border-selected focus:se-outline-none focus:se-shadow-focus-primary', 'disabled:se-bg-input-field-bg-disabled disabled:se-cursor-not-allowed disabled:se-opacity-50', className) })] }));
|
|
5
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
interface EditorLayoutProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
}
|
|
5
|
+
export declare function EditorLayout({ children }: EditorLayoutProps): import("react/jsx-runtime").JSX.Element;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=EditorLayout.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditorLayout.d.ts","sourceRoot":"","sources":["../../src/components/EditorLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,UAAU,iBAAiB;IACzB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AAED,wBAAgB,YAAY,CAAC,EAAE,QAAQ,EAAE,EAAE,iBAAiB,2CAE3D"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* EditorPanelShell — shared wrapper for all editor sidebars (editor, audit, review).
|
|
3
|
+
*
|
|
4
|
+
* Renders:
|
|
5
|
+
* 1. A draggable FAB (56×56 circle) portaled to document.body — always visible.
|
|
6
|
+
* Pitch black with the Syntrologie logo mark. Draggable to any screen edge.
|
|
7
|
+
* 2. A fixed-position panel container with semi-transparent background
|
|
8
|
+
* and backdrop blur, rendered only when `isOpen`.
|
|
9
|
+
*/
|
|
10
|
+
import type React from 'react';
|
|
11
|
+
export interface EditorPanelShellProps {
|
|
12
|
+
isOpen: boolean;
|
|
13
|
+
onToggle: () => void;
|
|
14
|
+
position?: 'left' | 'right';
|
|
15
|
+
panelId?: string;
|
|
16
|
+
/** Panel z-index (default 2147483647). ModularEditorPanel passes 10000. */
|
|
17
|
+
zIndex?: number;
|
|
18
|
+
/** Portal target for the FAB button. Defaults to document.body when omitted. */
|
|
19
|
+
portalTarget?: HTMLElement;
|
|
20
|
+
children: React.ReactNode;
|
|
21
|
+
}
|
|
22
|
+
export declare function EditorPanelShell({ isOpen, onToggle, position, panelId, zIndex, portalTarget, children, }: EditorPanelShellProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
//# sourceMappingURL=EditorPanelShell.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"EditorPanelShell.d.ts","sourceRoot":"","sources":["../../src/components/EditorPanelShell.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAU/B,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE,OAAO,CAAC;IAChB,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,2EAA2E;IAC3E,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,gFAAgF;IAChF,YAAY,CAAC,EAAE,WAAW,CAAC;IAC3B,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC3B;AA4JD,wBAAgB,gBAAgB,CAAC,EAC/B,MAAM,EACN,QAAQ,EACR,QAAkB,EAClB,OAAO,EACP,MAAmB,EACnB,YAAY,EACZ,QAAQ,GACT,EAAE,qBAAqB,2CAyCvB"}
|