@syntrologie/adapt-content 2.8.0-canary.90 → 2.8.0-canary.91
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/node_modules/@syntrologie/shared-editor-ui/dist/components/AnchorPickerLit.d.ts +62 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/AnchorPickerLit.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/AnchorPickerLit.js +255 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/BeforeAfterToggleLit.d.ts +25 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/BeforeAfterToggleLit.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/BeforeAfterToggleLit.js +55 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/ConditionStatusLineLit.d.ts +33 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/ConditionStatusLineLit.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/ConditionStatusLineLit.js +118 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/DetectionBadgeLit.d.ts +32 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/DetectionBadgeLit.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/DetectionBadgeLit.js +68 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/DismissedSectionLit.d.ts +34 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/DismissedSectionLit.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/DismissedSectionLit.js +57 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditBackButtonLit.d.ts +13 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditBackButtonLit.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditBackButtonLit.js +31 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorBodyLit.d.ts +7 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorBodyLit.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorBodyLit.js +15 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorCardLit.d.ts +36 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorCardLit.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorCardLit.js +102 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorFooterLit.d.ts +20 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorFooterLit.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorFooterLit.js +48 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorHeaderLit.d.ts +16 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorHeaderLit.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorHeaderLit.js +25 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorInputLit.d.ts +66 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorInputLit.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorInputLit.js +87 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorLayoutLit.d.ts +7 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorLayoutLit.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorLayoutLit.js +15 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorPanelShellLit.d.ts +66 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorPanelShellLit.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorPanelShellLit.js +527 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorSelectLit.d.ts +41 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorSelectLit.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorSelectLit.js +63 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorTextareaLit.d.ts +55 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorTextareaLit.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EditorTextareaLit.js +92 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/ElementHighlightLit.d.ts +90 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/ElementHighlightLit.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/ElementHighlightLit.js +241 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EmptyStateLit.d.ts +12 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EmptyStateLit.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/EmptyStateLit.js +21 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/GroupHeaderLit.d.ts +21 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/GroupHeaderLit.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/GroupHeaderLit.js +33 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/TriggerJourneyLit.d.ts +28 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/TriggerJourneyLit.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/components/TriggerJourneyLit.js +121 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/index.d.ts.map +1 -1
- package/node_modules/@syntrologie/shared-editor-ui/dist/lit-elements.d.ts +14 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/lit-elements.d.ts.map +1 -0
- package/node_modules/@syntrologie/shared-editor-ui/dist/lit-elements.js +13 -0
- package/node_modules/@syntrologie/shared-editor-ui/package.json +8 -1
- package/package.json +1 -1
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AnchorPickerLit — Shared Element Picker Overlay (Lit web component).
|
|
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
|
+
* via custom events.
|
|
7
|
+
*
|
|
8
|
+
* Appends its overlay to document.body (light DOM) to use
|
|
9
|
+
* document.elementFromPoint() for detecting host page elements under the cursor.
|
|
10
|
+
*
|
|
11
|
+
* Lit port of AnchorPicker.tsx — preserves all behavior including:
|
|
12
|
+
* - Mouse tracking with elementFromPoint detection
|
|
13
|
+
* - Passthrough click mode for PostHog integration
|
|
14
|
+
* - Element highlight with info tooltip
|
|
15
|
+
* - Escape key cancellation
|
|
16
|
+
* - Exclude selector filtering
|
|
17
|
+
*/
|
|
18
|
+
import { LitElement, nothing } from 'lit';
|
|
19
|
+
export interface PickedElement {
|
|
20
|
+
element: Element;
|
|
21
|
+
selector: string;
|
|
22
|
+
description: string;
|
|
23
|
+
}
|
|
24
|
+
export declare class AnchorPickerLit extends LitElement {
|
|
25
|
+
static properties: {
|
|
26
|
+
isActive: {
|
|
27
|
+
type: BooleanConstructor;
|
|
28
|
+
attribute: string;
|
|
29
|
+
};
|
|
30
|
+
passthroughClicks: {
|
|
31
|
+
type: BooleanConstructor;
|
|
32
|
+
attribute: string;
|
|
33
|
+
};
|
|
34
|
+
excludeSelector: {
|
|
35
|
+
type: StringConstructor;
|
|
36
|
+
attribute: string;
|
|
37
|
+
};
|
|
38
|
+
_hoveredElement: {
|
|
39
|
+
state: boolean;
|
|
40
|
+
};
|
|
41
|
+
_hoveredSelector: {
|
|
42
|
+
state: boolean;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
isActive: boolean;
|
|
46
|
+
passthroughClicks: boolean;
|
|
47
|
+
excludeSelector: string;
|
|
48
|
+
private _hoveredElement;
|
|
49
|
+
private _hoveredSelector;
|
|
50
|
+
private _overlayEl;
|
|
51
|
+
createRenderRoot(): this;
|
|
52
|
+
connectedCallback(): void;
|
|
53
|
+
disconnectedCallback(): void;
|
|
54
|
+
updated(changed: Map<string, unknown>): void;
|
|
55
|
+
private _attachDocumentListeners;
|
|
56
|
+
private _detachDocumentListeners;
|
|
57
|
+
private _handleMouseMove;
|
|
58
|
+
private _handleClick;
|
|
59
|
+
private _handleKeyDown;
|
|
60
|
+
render(): import("lit-html").TemplateResult<1> | typeof nothing;
|
|
61
|
+
}
|
|
62
|
+
//# sourceMappingURL=AnchorPickerLit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AnchorPickerLit.d.ts","sourceRoot":"","sources":["../../src/components/AnchorPickerLit.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AAEH,OAAO,EAAQ,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AAahD,MAAM,WAAW,aAAa;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,WAAW,EAAE,MAAM,CAAC;CACrB;AAgBD,qBAAa,eAAgB,SAAQ,UAAU;IAC7C,OAAgB,UAAU;;;;;;;;;;;;;;;;;;;MAOxB;IAEF,QAAQ,UAAS;IACjB,iBAAiB,UAAS;IAC1B,eAAe,EAAE,MAAM,CAA4B;IAGnD,OAAO,CAAC,eAAe,CAAwB;IAC/C,OAAO,CAAC,gBAAgB,CAAM;IAG9B,OAAO,CAAC,UAAU,CAA+B;IAIxC,gBAAgB;IAIhB,iBAAiB,IAAI,IAAI;IAOzB,oBAAoB,IAAI,IAAI;IAK5B,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI;IAiBrD,OAAO,CAAC,wBAAwB;IAQhC,OAAO,CAAC,wBAAwB;IAQhC,OAAO,CAAC,gBAAgB,CAoCtB;IAEF,OAAO,CAAC,YAAY,CAwBlB;IAEF,OAAO,CAAC,cAAc,CAUpB;IAIO,MAAM;CA0GhB"}
|
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* AnchorPickerLit — Shared Element Picker Overlay (Lit web component).
|
|
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
|
+
* via custom events.
|
|
7
|
+
*
|
|
8
|
+
* Appends its overlay to document.body (light DOM) to use
|
|
9
|
+
* document.elementFromPoint() for detecting host page elements under the cursor.
|
|
10
|
+
*
|
|
11
|
+
* Lit port of AnchorPicker.tsx — preserves all behavior including:
|
|
12
|
+
* - Mouse tracking with elementFromPoint detection
|
|
13
|
+
* - Passthrough click mode for PostHog integration
|
|
14
|
+
* - Element highlight with info tooltip
|
|
15
|
+
* - Escape key cancellation
|
|
16
|
+
* - Exclude selector filtering
|
|
17
|
+
*/
|
|
18
|
+
import { html, LitElement, nothing } from 'lit';
|
|
19
|
+
import { styleMap } from 'lit/directives/style-map.js';
|
|
20
|
+
import { generateSelector, getElementDescription, validateSelector, } from '../utils/selectorGenerator';
|
|
21
|
+
// =============================================================================
|
|
22
|
+
// Constants
|
|
23
|
+
// =============================================================================
|
|
24
|
+
const HIGHLIGHT_COLOR = '#3b82f6';
|
|
25
|
+
const HIGHLIGHT_BG = 'rgba(59, 130, 246, 0.1)';
|
|
26
|
+
const DEFAULT_EXCLUDE_SELECTOR = '[data-syntro-editor-panel], [data-shadow-canvas-id], .syntro-tooltip, .syntro-modal, .syntro-highlight, [data-syntro-anchor-picker]';
|
|
27
|
+
// =============================================================================
|
|
28
|
+
// Component
|
|
29
|
+
// =============================================================================
|
|
30
|
+
export class AnchorPickerLit extends LitElement {
|
|
31
|
+
constructor() {
|
|
32
|
+
super(...arguments);
|
|
33
|
+
this.isActive = false;
|
|
34
|
+
this.passthroughClicks = false;
|
|
35
|
+
this.excludeSelector = DEFAULT_EXCLUDE_SELECTOR;
|
|
36
|
+
// Internal state
|
|
37
|
+
this._hoveredElement = null;
|
|
38
|
+
this._hoveredSelector = '';
|
|
39
|
+
// DOM ref for the overlay
|
|
40
|
+
this._overlayEl = null;
|
|
41
|
+
// ---- EVENT HANDLERS ----
|
|
42
|
+
this._handleMouseMove = (e) => {
|
|
43
|
+
const overlay = this._overlayEl;
|
|
44
|
+
// In passthrough mode the overlay is already pointerEvents:'none',
|
|
45
|
+
// so elementFromPoint can see through it -- no toggle needed.
|
|
46
|
+
// In non-passthrough mode, temporarily disable to detect elements underneath.
|
|
47
|
+
if (overlay && !this.passthroughClicks) {
|
|
48
|
+
overlay.style.pointerEvents = 'none';
|
|
49
|
+
}
|
|
50
|
+
const elementAtPoint = document.elementFromPoint(e.clientX, e.clientY);
|
|
51
|
+
if (overlay && !this.passthroughClicks) {
|
|
52
|
+
overlay.style.pointerEvents = 'auto';
|
|
53
|
+
}
|
|
54
|
+
if (!elementAtPoint) {
|
|
55
|
+
this._hoveredElement = null;
|
|
56
|
+
this._hoveredSelector = '';
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
if (this.excludeSelector && elementAtPoint.closest(this.excludeSelector)) {
|
|
60
|
+
this._hoveredElement = null;
|
|
61
|
+
this._hoveredSelector = '';
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
if (['HTML', 'BODY', 'HEAD'].includes(elementAtPoint.tagName)) {
|
|
65
|
+
this._hoveredElement = null;
|
|
66
|
+
this._hoveredSelector = '';
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
this._hoveredElement = elementAtPoint;
|
|
70
|
+
this._hoveredSelector = generateSelector(elementAtPoint);
|
|
71
|
+
};
|
|
72
|
+
this._handleClick = (e) => {
|
|
73
|
+
if (this.passthroughClicks)
|
|
74
|
+
return; // Let click propagate to PostHog
|
|
75
|
+
e.preventDefault();
|
|
76
|
+
e.stopPropagation();
|
|
77
|
+
if (this._hoveredElement && this._hoveredSelector) {
|
|
78
|
+
let selector = this._hoveredSelector;
|
|
79
|
+
if (!validateSelector(selector, this._hoveredElement)) {
|
|
80
|
+
selector = generateSelector(this._hoveredElement);
|
|
81
|
+
}
|
|
82
|
+
this.dispatchEvent(new CustomEvent('pick', {
|
|
83
|
+
detail: {
|
|
84
|
+
element: this._hoveredElement,
|
|
85
|
+
selector,
|
|
86
|
+
description: getElementDescription(this._hoveredElement),
|
|
87
|
+
},
|
|
88
|
+
bubbles: true,
|
|
89
|
+
composed: true,
|
|
90
|
+
}));
|
|
91
|
+
}
|
|
92
|
+
};
|
|
93
|
+
this._handleKeyDown = (e) => {
|
|
94
|
+
if (e.key === 'Escape') {
|
|
95
|
+
e.preventDefault();
|
|
96
|
+
this.dispatchEvent(new CustomEvent('cancel', {
|
|
97
|
+
bubbles: true,
|
|
98
|
+
composed: true,
|
|
99
|
+
}));
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
// No _bound* wrappers needed — methods are arrow class fields
|
|
104
|
+
createRenderRoot() {
|
|
105
|
+
return this;
|
|
106
|
+
}
|
|
107
|
+
connectedCallback() {
|
|
108
|
+
super.connectedCallback();
|
|
109
|
+
if (this.isActive) {
|
|
110
|
+
this._attachDocumentListeners();
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
disconnectedCallback() {
|
|
114
|
+
super.disconnectedCallback();
|
|
115
|
+
this._detachDocumentListeners();
|
|
116
|
+
}
|
|
117
|
+
updated(changed) {
|
|
118
|
+
if (changed.has('isActive')) {
|
|
119
|
+
if (this.isActive) {
|
|
120
|
+
this._attachDocumentListeners();
|
|
121
|
+
}
|
|
122
|
+
else {
|
|
123
|
+
this._detachDocumentListeners();
|
|
124
|
+
this._hoveredElement = null;
|
|
125
|
+
this._hoveredSelector = '';
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
// Cache overlay ref after render
|
|
129
|
+
this._overlayEl = this.querySelector('[data-syntro-anchor-picker]');
|
|
130
|
+
}
|
|
131
|
+
// ---- DOCUMENT LISTENERS ----
|
|
132
|
+
_attachDocumentListeners() {
|
|
133
|
+
document.addEventListener('mousemove', this._handleMouseMove, true);
|
|
134
|
+
if (!this.passthroughClicks) {
|
|
135
|
+
document.addEventListener('click', this._handleClick, true);
|
|
136
|
+
}
|
|
137
|
+
document.addEventListener('keydown', this._handleKeyDown, true);
|
|
138
|
+
}
|
|
139
|
+
_detachDocumentListeners() {
|
|
140
|
+
document.removeEventListener('mousemove', this._handleMouseMove, true);
|
|
141
|
+
document.removeEventListener('click', this._handleClick, true);
|
|
142
|
+
document.removeEventListener('keydown', this._handleKeyDown, true);
|
|
143
|
+
}
|
|
144
|
+
// ---- RENDER ----
|
|
145
|
+
render() {
|
|
146
|
+
if (!this.isActive)
|
|
147
|
+
return nothing;
|
|
148
|
+
const hovered = this._hoveredElement;
|
|
149
|
+
const rect = hovered?.getBoundingClientRect() ?? null;
|
|
150
|
+
return html `
|
|
151
|
+
<div
|
|
152
|
+
data-syntro-anchor-picker
|
|
153
|
+
style=${styleMap({
|
|
154
|
+
position: 'fixed',
|
|
155
|
+
inset: '0',
|
|
156
|
+
cursor: 'crosshair',
|
|
157
|
+
zIndex: '2147483644',
|
|
158
|
+
pointerEvents: this.passthroughClicks ? 'none' : 'auto',
|
|
159
|
+
})}
|
|
160
|
+
>
|
|
161
|
+
<!-- Semi-transparent overlay -->
|
|
162
|
+
<div
|
|
163
|
+
style=${styleMap({
|
|
164
|
+
position: 'absolute',
|
|
165
|
+
inset: '0',
|
|
166
|
+
background: 'rgba(0, 0, 0, 0.08)',
|
|
167
|
+
pointerEvents: 'none',
|
|
168
|
+
})}
|
|
169
|
+
></div>
|
|
170
|
+
|
|
171
|
+
<!-- Element highlight -->
|
|
172
|
+
${hovered && rect
|
|
173
|
+
? html `<div
|
|
174
|
+
style=${styleMap({
|
|
175
|
+
position: 'fixed',
|
|
176
|
+
left: `${rect.left - 2}px`,
|
|
177
|
+
top: `${rect.top - 2}px`,
|
|
178
|
+
width: `${rect.width + 4}px`,
|
|
179
|
+
height: `${rect.height + 4}px`,
|
|
180
|
+
border: `2px solid ${HIGHLIGHT_COLOR}`,
|
|
181
|
+
backgroundColor: HIGHLIGHT_BG,
|
|
182
|
+
borderRadius: '4px',
|
|
183
|
+
boxShadow: '0 0 0 9999px rgba(0, 0, 0, 0.2)',
|
|
184
|
+
pointerEvents: 'none',
|
|
185
|
+
transition: 'all 0.1s ease-out',
|
|
186
|
+
})}
|
|
187
|
+
></div>`
|
|
188
|
+
: nothing}
|
|
189
|
+
|
|
190
|
+
<!-- Element info tooltip near hovered element -->
|
|
191
|
+
${hovered && rect
|
|
192
|
+
? html `<div
|
|
193
|
+
class="se-text-xs"
|
|
194
|
+
style=${styleMap({
|
|
195
|
+
position: 'fixed',
|
|
196
|
+
left: `${Math.max(8, Math.min(rect.left, window.innerWidth - 320))}px`,
|
|
197
|
+
top: `${Math.max(8, rect.top - 68)}px`,
|
|
198
|
+
backgroundColor: '#1e293b',
|
|
199
|
+
color: '#e2e8f0',
|
|
200
|
+
padding: '8px 12px',
|
|
201
|
+
borderRadius: '6px',
|
|
202
|
+
boxShadow: '0 4px 12px rgba(0, 0, 0, 0.3)',
|
|
203
|
+
zIndex: '1',
|
|
204
|
+
fontFamily: 'monospace',
|
|
205
|
+
maxWidth: '300px',
|
|
206
|
+
pointerEvents: 'none',
|
|
207
|
+
})}
|
|
208
|
+
>
|
|
209
|
+
<div
|
|
210
|
+
class="se-text-xs"
|
|
211
|
+
style=${styleMap({
|
|
212
|
+
textTransform: 'uppercase',
|
|
213
|
+
letterSpacing: '0.05em',
|
|
214
|
+
marginBottom: '4px',
|
|
215
|
+
color: '#94a3b8',
|
|
216
|
+
})}
|
|
217
|
+
>
|
|
218
|
+
Click to select
|
|
219
|
+
</div>
|
|
220
|
+
<div
|
|
221
|
+
style=${styleMap({
|
|
222
|
+
color: '#38bdf8',
|
|
223
|
+
overflow: 'hidden',
|
|
224
|
+
textOverflow: 'ellipsis',
|
|
225
|
+
whiteSpace: 'nowrap',
|
|
226
|
+
})}
|
|
227
|
+
>
|
|
228
|
+
${this._hoveredSelector}
|
|
229
|
+
</div>
|
|
230
|
+
<div
|
|
231
|
+
style=${styleMap({
|
|
232
|
+
marginTop: '4px',
|
|
233
|
+
color: '#cbd5e1',
|
|
234
|
+
overflow: 'hidden',
|
|
235
|
+
textOverflow: 'ellipsis',
|
|
236
|
+
whiteSpace: 'nowrap',
|
|
237
|
+
})}
|
|
238
|
+
>
|
|
239
|
+
${getElementDescription(hovered)}
|
|
240
|
+
</div>
|
|
241
|
+
</div>`
|
|
242
|
+
: nothing}
|
|
243
|
+
</div>
|
|
244
|
+
`;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
AnchorPickerLit.properties = {
|
|
248
|
+
isActive: { type: Boolean, attribute: 'is-active' },
|
|
249
|
+
passthroughClicks: { type: Boolean, attribute: 'passthrough-clicks' },
|
|
250
|
+
excludeSelector: { type: String, attribute: 'exclude-selector' },
|
|
251
|
+
// Internal reactive state (not attributes)
|
|
252
|
+
_hoveredElement: { state: true },
|
|
253
|
+
_hoveredSelector: { state: true },
|
|
254
|
+
};
|
|
255
|
+
customElements.define('se-anchor-picker', AnchorPickerLit);
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* BeforeAfterToggleLit — toggle switch between before/after states.
|
|
4
|
+
*
|
|
5
|
+
* Attributes:
|
|
6
|
+
* mode: 'before' | 'after'
|
|
7
|
+
*
|
|
8
|
+
* Events:
|
|
9
|
+
* toggle — CustomEvent<{ mode: 'before' | 'after' }>, bubbles, composed
|
|
10
|
+
*
|
|
11
|
+
* Usage:
|
|
12
|
+
* <se-before-after-toggle mode="before"></se-before-after-toggle>
|
|
13
|
+
*/
|
|
14
|
+
export declare class BeforeAfterToggleLit extends LitElement {
|
|
15
|
+
static properties: {
|
|
16
|
+
mode: {
|
|
17
|
+
type: StringConstructor;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
mode: 'before' | 'after';
|
|
21
|
+
createRenderRoot(): this;
|
|
22
|
+
private _handleToggle;
|
|
23
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=BeforeAfterToggleLit.d.ts.map
|
package/node_modules/@syntrologie/shared-editor-ui/dist/components/BeforeAfterToggleLit.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BeforeAfterToggleLit.d.ts","sourceRoot":"","sources":["../../src/components/BeforeAfterToggleLit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,UAAU,EAAE,MAAM,KAAK,CAAC;AAEvC;;;;;;;;;;;GAWG;AACH,qBAAa,oBAAqB,SAAQ,UAAU;IAClD,OAAgB,UAAU;;;;MAExB;IAEF,IAAI,EAAE,QAAQ,GAAG,OAAO,CAAY;IAE3B,gBAAgB;IAIzB,OAAO,CAAC,aAAa;IAWZ,MAAM;CAwBhB"}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { html, LitElement } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* BeforeAfterToggleLit — toggle switch between before/after states.
|
|
4
|
+
*
|
|
5
|
+
* Attributes:
|
|
6
|
+
* mode: 'before' | 'after'
|
|
7
|
+
*
|
|
8
|
+
* Events:
|
|
9
|
+
* toggle — CustomEvent<{ mode: 'before' | 'after' }>, bubbles, composed
|
|
10
|
+
*
|
|
11
|
+
* Usage:
|
|
12
|
+
* <se-before-after-toggle mode="before"></se-before-after-toggle>
|
|
13
|
+
*/
|
|
14
|
+
export class BeforeAfterToggleLit extends LitElement {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
this.mode = 'before';
|
|
18
|
+
}
|
|
19
|
+
createRenderRoot() {
|
|
20
|
+
return this;
|
|
21
|
+
}
|
|
22
|
+
_handleToggle(value) {
|
|
23
|
+
this.mode = value;
|
|
24
|
+
this.dispatchEvent(new CustomEvent('toggle', {
|
|
25
|
+
detail: { mode: value },
|
|
26
|
+
bubbles: true,
|
|
27
|
+
composed: true,
|
|
28
|
+
}));
|
|
29
|
+
}
|
|
30
|
+
render() {
|
|
31
|
+
const beforeActive = this.mode === 'before';
|
|
32
|
+
const afterActive = this.mode === 'after';
|
|
33
|
+
const baseBtn = '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';
|
|
34
|
+
const beforeClasses = `${baseBtn} ${beforeActive ? 'se-bg-blue-5/30 se-text-blue-5' : 'se-bg-transparent se-text-text-secondary'}`;
|
|
35
|
+
const afterClasses = `${baseBtn} se-border-l se-border-border-primary ${afterActive ? 'se-bg-blue-5/30 se-text-blue-5' : 'se-bg-transparent se-text-text-secondary'}`;
|
|
36
|
+
return html `
|
|
37
|
+
<div class="se-flex se-mb-3 se-rounded-lg se-overflow-hidden se-border se-border-border-primary">
|
|
38
|
+
<button
|
|
39
|
+
type="button"
|
|
40
|
+
class=${beforeClasses}
|
|
41
|
+
@click=${() => this._handleToggle('before')}
|
|
42
|
+
>Before</button>
|
|
43
|
+
<button
|
|
44
|
+
type="button"
|
|
45
|
+
class=${afterClasses}
|
|
46
|
+
@click=${() => this._handleToggle('after')}
|
|
47
|
+
>After</button>
|
|
48
|
+
</div>
|
|
49
|
+
`;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
BeforeAfterToggleLit.properties = {
|
|
53
|
+
mode: { type: String },
|
|
54
|
+
};
|
|
55
|
+
customElements.define('se-before-after-toggle', BeforeAfterToggleLit);
|
package/node_modules/@syntrologie/shared-editor-ui/dist/components/ConditionStatusLineLit.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
import type { TriggerWhenStatus } from './ConditionStatusLine';
|
|
3
|
+
/**
|
|
4
|
+
* ConditionStatusLineLit — inline triggerWhen diagnostic on EditorCard.
|
|
5
|
+
*
|
|
6
|
+
* Shows a compact one-line status for items with triggerWhen conditions.
|
|
7
|
+
* Click to expand per-condition detail (multi-condition case).
|
|
8
|
+
*
|
|
9
|
+
* Attributes:
|
|
10
|
+
* status — JSON-serialized TriggerWhenStatus (set via property, not attribute)
|
|
11
|
+
*
|
|
12
|
+
* Usage:
|
|
13
|
+
* const el = document.createElement('se-condition-status-line');
|
|
14
|
+
* el.status = { visible: true, isFallback: false, conditions: [...] };
|
|
15
|
+
*/
|
|
16
|
+
export declare class ConditionStatusLineLit extends LitElement {
|
|
17
|
+
static properties: {
|
|
18
|
+
status: {
|
|
19
|
+
type: ObjectConstructor;
|
|
20
|
+
};
|
|
21
|
+
_expanded: {
|
|
22
|
+
type: BooleanConstructor;
|
|
23
|
+
state: boolean;
|
|
24
|
+
};
|
|
25
|
+
};
|
|
26
|
+
status: TriggerWhenStatus | null;
|
|
27
|
+
private _expanded;
|
|
28
|
+
createRenderRoot(): this;
|
|
29
|
+
private _renderProgressBar;
|
|
30
|
+
private _renderConditionRow;
|
|
31
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=ConditionStatusLineLit.d.ts.map
|
package/node_modules/@syntrologie/shared-editor-ui/dist/components/ConditionStatusLineLit.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ConditionStatusLineLit.d.ts","sourceRoot":"","sources":["../../src/components/ConditionStatusLineLit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,UAAU,EAAE,MAAM,KAAK,CAAC;AACvC,OAAO,KAAK,EAAmB,iBAAiB,EAAE,MAAM,uBAAuB,CAAC;AAEhF;;;;;;;;;;;;GAYG;AACH,qBAAa,sBAAuB,SAAQ,UAAU;IACpD,OAAgB,UAAU;;;;;;;;MAGxB;IAEF,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAAQ;IACxC,OAAO,CAAC,SAAS,CAAS;IAEjB,gBAAgB;IAIzB,OAAO,CAAC,kBAAkB;IAgB1B,OAAO,CAAC,mBAAmB;IAwBlB,MAAM;CA+DhB"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { html, LitElement } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* ConditionStatusLineLit — inline triggerWhen diagnostic on EditorCard.
|
|
4
|
+
*
|
|
5
|
+
* Shows a compact one-line status for items with triggerWhen conditions.
|
|
6
|
+
* Click to expand per-condition detail (multi-condition case).
|
|
7
|
+
*
|
|
8
|
+
* Attributes:
|
|
9
|
+
* status — JSON-serialized TriggerWhenStatus (set via property, not attribute)
|
|
10
|
+
*
|
|
11
|
+
* Usage:
|
|
12
|
+
* const el = document.createElement('se-condition-status-line');
|
|
13
|
+
* el.status = { visible: true, isFallback: false, conditions: [...] };
|
|
14
|
+
*/
|
|
15
|
+
export class ConditionStatusLineLit extends LitElement {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
18
|
+
this.status = null;
|
|
19
|
+
this._expanded = false;
|
|
20
|
+
}
|
|
21
|
+
createRenderRoot() {
|
|
22
|
+
return this;
|
|
23
|
+
}
|
|
24
|
+
_renderProgressBar(current, target) {
|
|
25
|
+
const pct = Math.min(100, Math.round((current / Math.max(target, 1)) * 100));
|
|
26
|
+
const fillClass = pct >= 100 ? 'se-bg-green-4' : 'se-bg-blue-4';
|
|
27
|
+
return html `
|
|
28
|
+
<span
|
|
29
|
+
class="se-inline-block se-w-12 se-h-1.5 se-rounded-full se-bg-white/20 se-align-middle se-ml-1"
|
|
30
|
+
title="${current}/${target} (${pct}%)"
|
|
31
|
+
>
|
|
32
|
+
<span
|
|
33
|
+
class="se-block se-h-full se-rounded-full se-transition-all ${fillClass}"
|
|
34
|
+
style="width: ${pct}%"
|
|
35
|
+
></span>
|
|
36
|
+
</span>
|
|
37
|
+
`;
|
|
38
|
+
}
|
|
39
|
+
_renderConditionRow(cs) {
|
|
40
|
+
return html `
|
|
41
|
+
<div class="se-flex se-items-center se-gap-1 se-pl-3 se-text-[12px] se-font-medium se-text-text-secondary">
|
|
42
|
+
${cs.passed
|
|
43
|
+
? html `<svg class="se-w-3 se-h-3 se-text-green-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>`
|
|
44
|
+
: html `<svg class="se-w-3 se-h-3 se-text-red-4" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><line x1="18" y1="6" x2="6" y2="18"/><line x1="6" y1="6" x2="18" y2="18"/></svg>`}
|
|
45
|
+
<span>${cs.type}:</span>
|
|
46
|
+
<span class="se-text-text-secondary">${cs.formatted.label}</span>
|
|
47
|
+
${cs.formatted.progress
|
|
48
|
+
? html `
|
|
49
|
+
${this._renderProgressBar(cs.formatted.progress.current, cs.formatted.progress.target)}
|
|
50
|
+
<span class="se-text-text-secondary se-ml-0.5">
|
|
51
|
+
${cs.formatted.progress.current}/${cs.formatted.progress.target}
|
|
52
|
+
</span>
|
|
53
|
+
`
|
|
54
|
+
: ''}
|
|
55
|
+
</div>
|
|
56
|
+
`;
|
|
57
|
+
}
|
|
58
|
+
render() {
|
|
59
|
+
if (!this.status)
|
|
60
|
+
return html ``;
|
|
61
|
+
const { visible, conditions } = this.status;
|
|
62
|
+
const passedCount = conditions.filter((c) => c.passed).length;
|
|
63
|
+
const totalCount = conditions.length;
|
|
64
|
+
const isSingle = totalCount === 1;
|
|
65
|
+
const iconColor = visible ? 'se-text-green-4' : 'se-text-yellow-5';
|
|
66
|
+
// Check icon (visible) or Clock icon (not visible)
|
|
67
|
+
const statusIcon = visible
|
|
68
|
+
? html `<svg class="se-w-3 se-h-3 ${iconColor}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>`
|
|
69
|
+
: html `<svg class="se-w-3 se-h-3 ${iconColor}" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><polyline points="12 6 12 12 16 14"/></svg>`;
|
|
70
|
+
if (isSingle) {
|
|
71
|
+
const cs = conditions[0];
|
|
72
|
+
return html `
|
|
73
|
+
<div class="se-text-[12px] se-font-medium se-text-text-secondary se-mt-0.5 se-flex se-items-center se-gap-1">
|
|
74
|
+
${statusIcon}
|
|
75
|
+
<span>${cs.type}:</span>
|
|
76
|
+
<span class="se-text-text-secondary">${cs.formatted.label}</span>
|
|
77
|
+
${cs.formatted.progress
|
|
78
|
+
? html `
|
|
79
|
+
${this._renderProgressBar(cs.formatted.progress.current, cs.formatted.progress.target)}
|
|
80
|
+
<span class="se-text-text-secondary se-ml-0.5">
|
|
81
|
+
${cs.formatted.progress.current}/${cs.formatted.progress.target}
|
|
82
|
+
</span>
|
|
83
|
+
`
|
|
84
|
+
: ''}
|
|
85
|
+
</div>
|
|
86
|
+
`;
|
|
87
|
+
}
|
|
88
|
+
// Multi-condition: summary + expandable detail
|
|
89
|
+
return html `
|
|
90
|
+
<div class="se-mt-0.5">
|
|
91
|
+
<button
|
|
92
|
+
type="button"
|
|
93
|
+
class="se-flex se-items-center se-gap-1 se-text-[12px] se-font-medium se-text-text-secondary se-bg-transparent se-border-none se-cursor-pointer se-p-0 hover:se-text-text-primary"
|
|
94
|
+
@click=${(e) => {
|
|
95
|
+
e.stopPropagation();
|
|
96
|
+
this._expanded = !this._expanded;
|
|
97
|
+
}}
|
|
98
|
+
>
|
|
99
|
+
${statusIcon}
|
|
100
|
+
<span>${passedCount} of ${totalCount} conditions met</span>
|
|
101
|
+
<span class="se-text-[11px] se-ml-0.5">${this._expanded ? '▲' : '▼'}</span>
|
|
102
|
+
</button>
|
|
103
|
+
${this._expanded
|
|
104
|
+
? html `
|
|
105
|
+
<div class="se-mt-0.5 se-space-y-0.5">
|
|
106
|
+
${conditions.map((cs) => this._renderConditionRow(cs))}
|
|
107
|
+
</div>
|
|
108
|
+
`
|
|
109
|
+
: ''}
|
|
110
|
+
</div>
|
|
111
|
+
`;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
ConditionStatusLineLit.properties = {
|
|
115
|
+
status: { type: Object },
|
|
116
|
+
_expanded: { type: Boolean, state: true },
|
|
117
|
+
};
|
|
118
|
+
customElements.define('se-condition-status-line', ConditionStatusLineLit);
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { LitElement } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* DetectionBadgeLit — badge showing element detection status.
|
|
4
|
+
*
|
|
5
|
+
* Attributes:
|
|
6
|
+
* found — boolean, whether the element was found on the page
|
|
7
|
+
* clickable — boolean, whether clicking should be enabled (renders as button)
|
|
8
|
+
*
|
|
9
|
+
* Events:
|
|
10
|
+
* badge-click — CustomEvent<void>, bubbles, composed (only when clickable=true)
|
|
11
|
+
*
|
|
12
|
+
* Usage:
|
|
13
|
+
* <se-detection-badge found></se-detection-badge>
|
|
14
|
+
* <se-detection-badge found clickable></se-detection-badge>
|
|
15
|
+
*/
|
|
16
|
+
export declare class DetectionBadgeLit extends LitElement {
|
|
17
|
+
static properties: {
|
|
18
|
+
found: {
|
|
19
|
+
type: BooleanConstructor;
|
|
20
|
+
};
|
|
21
|
+
clickable: {
|
|
22
|
+
type: BooleanConstructor;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
found: boolean;
|
|
26
|
+
clickable: boolean;
|
|
27
|
+
createRenderRoot(): this;
|
|
28
|
+
private get _title();
|
|
29
|
+
private _handleClick;
|
|
30
|
+
render(): import("lit-html").TemplateResult<1>;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=DetectionBadgeLit.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DetectionBadgeLit.d.ts","sourceRoot":"","sources":["../../src/components/DetectionBadgeLit.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,UAAU,EAAE,MAAM,KAAK,CAAC;AAEvC;;;;;;;;;;;;;GAaG;AACH,qBAAa,iBAAkB,SAAQ,UAAU;IAC/C,OAAgB,UAAU;;;;;;;MAGxB;IAEF,KAAK,UAAS;IACd,SAAS,UAAS;IAET,gBAAgB;IAIzB,OAAO,KAAK,MAAM,GAKjB;IAED,OAAO,CAAC,YAAY;IAUX,MAAM;CA6BhB"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { html, LitElement } from 'lit';
|
|
2
|
+
/**
|
|
3
|
+
* DetectionBadgeLit — badge showing element detection status.
|
|
4
|
+
*
|
|
5
|
+
* Attributes:
|
|
6
|
+
* found — boolean, whether the element was found on the page
|
|
7
|
+
* clickable — boolean, whether clicking should be enabled (renders as button)
|
|
8
|
+
*
|
|
9
|
+
* Events:
|
|
10
|
+
* badge-click — CustomEvent<void>, bubbles, composed (only when clickable=true)
|
|
11
|
+
*
|
|
12
|
+
* Usage:
|
|
13
|
+
* <se-detection-badge found></se-detection-badge>
|
|
14
|
+
* <se-detection-badge found clickable></se-detection-badge>
|
|
15
|
+
*/
|
|
16
|
+
export class DetectionBadgeLit extends LitElement {
|
|
17
|
+
constructor() {
|
|
18
|
+
super(...arguments);
|
|
19
|
+
this.found = false;
|
|
20
|
+
this.clickable = false;
|
|
21
|
+
}
|
|
22
|
+
createRenderRoot() {
|
|
23
|
+
return this;
|
|
24
|
+
}
|
|
25
|
+
get _title() {
|
|
26
|
+
if (this.clickable) {
|
|
27
|
+
return this.found ? 'Click to scroll to element' : 'Click to navigate to page';
|
|
28
|
+
}
|
|
29
|
+
return this.found ? 'Found on this page' : 'Not found on this page';
|
|
30
|
+
}
|
|
31
|
+
_handleClick(e) {
|
|
32
|
+
e.stopPropagation();
|
|
33
|
+
this.dispatchEvent(new CustomEvent('badge-click', {
|
|
34
|
+
bubbles: true,
|
|
35
|
+
composed: true,
|
|
36
|
+
}));
|
|
37
|
+
}
|
|
38
|
+
render() {
|
|
39
|
+
const textColor = this.found ? 'se-text-green-4' : 'se-text-text-tertiary';
|
|
40
|
+
const dotColor = this.found ? 'se-bg-green-4' : 'se-bg-text-tertiary';
|
|
41
|
+
const dot = html `<span data-indicator class="se-w-1.5 se-h-1.5 se-rounded-full ${dotColor}"></span>`;
|
|
42
|
+
const baseClasses = `se-inline-flex se-items-center se-gap-1 se-text-xs se-font-medium se-shrink-0 ${textColor}`;
|
|
43
|
+
if (this.clickable) {
|
|
44
|
+
return html `
|
|
45
|
+
<button
|
|
46
|
+
type="button"
|
|
47
|
+
class="${baseClasses} se-cursor-pointer hover:se-opacity-80 se-border-none se-bg-transparent se-p-0"
|
|
48
|
+
title=${this._title}
|
|
49
|
+
@click=${this._handleClick}
|
|
50
|
+
>
|
|
51
|
+
${dot}
|
|
52
|
+
GoTo
|
|
53
|
+
</button>
|
|
54
|
+
`;
|
|
55
|
+
}
|
|
56
|
+
return html `
|
|
57
|
+
<span class=${baseClasses} title=${this._title}>
|
|
58
|
+
${dot}
|
|
59
|
+
GoTo
|
|
60
|
+
</span>
|
|
61
|
+
`;
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
DetectionBadgeLit.properties = {
|
|
65
|
+
found: { type: Boolean },
|
|
66
|
+
clickable: { type: Boolean },
|
|
67
|
+
};
|
|
68
|
+
customElements.define('se-detection-badge', DetectionBadgeLit);
|