@bendyline/squisq-react 1.3.0 → 1.3.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/index.d.ts +710 -35
- package/dist/index.js +4288 -33
- package/dist/index.js.map +1 -1
- package/dist/squisq-player.global.js +1 -1
- package/dist/standalone-source.js +1 -1
- package/package.json +3 -3
- package/src/standalone-source.d.ts +10 -0
- package/dist/BlockRenderer.d.ts +0 -37
- package/dist/BlockRenderer.d.ts.map +0 -1
- package/dist/BlockRenderer.js +0 -54
- package/dist/BlockRenderer.js.map +0 -1
- package/dist/CaptionOverlay.d.ts +0 -33
- package/dist/CaptionOverlay.d.ts.map +0 -1
- package/dist/CaptionOverlay.js +0 -44
- package/dist/CaptionOverlay.js.map +0 -1
- package/dist/DocControlsBottom.d.ts +0 -28
- package/dist/DocControlsBottom.d.ts.map +0 -1
- package/dist/DocControlsBottom.js +0 -27
- package/dist/DocControlsBottom.js.map +0 -1
- package/dist/DocControlsOverlay.d.ts +0 -28
- package/dist/DocControlsOverlay.d.ts.map +0 -1
- package/dist/DocControlsOverlay.js +0 -80
- package/dist/DocControlsOverlay.js.map +0 -1
- package/dist/DocControlsSidebar.d.ts +0 -27
- package/dist/DocControlsSidebar.d.ts.map +0 -1
- package/dist/DocControlsSidebar.js +0 -10
- package/dist/DocControlsSidebar.js.map +0 -1
- package/dist/DocControlsSlideshow.d.ts +0 -20
- package/dist/DocControlsSlideshow.d.ts.map +0 -1
- package/dist/DocControlsSlideshow.js +0 -69
- package/dist/DocControlsSlideshow.js.map +0 -1
- package/dist/DocPlayer.d.ts +0 -97
- package/dist/DocPlayer.d.ts.map +0 -1
- package/dist/DocPlayer.js +0 -657
- package/dist/DocPlayer.js.map +0 -1
- package/dist/DocPlayerWithSidebar.d.ts +0 -41
- package/dist/DocPlayerWithSidebar.d.ts.map +0 -1
- package/dist/DocPlayerWithSidebar.js +0 -69
- package/dist/DocPlayerWithSidebar.js.map +0 -1
- package/dist/DocProgressBar.d.ts +0 -31
- package/dist/DocProgressBar.d.ts.map +0 -1
- package/dist/DocProgressBar.js +0 -122
- package/dist/DocProgressBar.js.map +0 -1
- package/dist/InlineAudioPlayer.d.ts +0 -15
- package/dist/InlineAudioPlayer.d.ts.map +0 -1
- package/dist/InlineAudioPlayer.js +0 -22
- package/dist/InlineAudioPlayer.js.map +0 -1
- package/dist/InlineVideoPlayer.d.ts +0 -21
- package/dist/InlineVideoPlayer.d.ts.map +0 -1
- package/dist/InlineVideoPlayer.js +0 -29
- package/dist/InlineVideoPlayer.js.map +0 -1
- package/dist/LinearDocView.d.ts +0 -73
- package/dist/LinearDocView.d.ts.map +0 -1
- package/dist/LinearDocView.js +0 -451
- package/dist/LinearDocView.js.map +0 -1
- package/dist/MarkdownRenderer.d.ts +0 -32
- package/dist/MarkdownRenderer.d.ts.map +0 -1
- package/dist/MarkdownRenderer.js +0 -259
- package/dist/MarkdownRenderer.js.map +0 -1
- package/dist/SocialCaptionOverlay.d.ts +0 -27
- package/dist/SocialCaptionOverlay.d.ts.map +0 -1
- package/dist/SocialCaptionOverlay.js +0 -185
- package/dist/SocialCaptionOverlay.js.map +0 -1
- package/dist/__tests__/BlockRenderer.test.d.ts +0 -2
- package/dist/__tests__/BlockRenderer.test.d.ts.map +0 -1
- package/dist/__tests__/BlockRenderer.test.js +0 -82
- package/dist/__tests__/BlockRenderer.test.js.map +0 -1
- package/dist/__tests__/DocControlsSlideshow.test.d.ts +0 -2
- package/dist/__tests__/DocControlsSlideshow.test.d.ts.map +0 -1
- package/dist/__tests__/DocControlsSlideshow.test.js +0 -89
- package/dist/__tests__/DocControlsSlideshow.test.js.map +0 -1
- package/dist/__tests__/JsonView.test.d.ts +0 -2
- package/dist/__tests__/JsonView.test.d.ts.map +0 -1
- package/dist/__tests__/JsonView.test.js +0 -93
- package/dist/__tests__/JsonView.test.js.map +0 -1
- package/dist/__tests__/LinearDocView.test.d.ts +0 -2
- package/dist/__tests__/LinearDocView.test.d.ts.map +0 -1
- package/dist/__tests__/LinearDocView.test.js +0 -250
- package/dist/__tests__/LinearDocView.test.js.map +0 -1
- package/dist/__tests__/MarkdownRenderer.test.d.ts +0 -2
- package/dist/__tests__/MarkdownRenderer.test.d.ts.map +0 -1
- package/dist/__tests__/MarkdownRenderer.test.js +0 -208
- package/dist/__tests__/MarkdownRenderer.test.js.map +0 -1
- package/dist/__tests__/TableLayer.test.d.ts +0 -2
- package/dist/__tests__/TableLayer.test.d.ts.map +0 -1
- package/dist/__tests__/TableLayer.test.js +0 -121
- package/dist/__tests__/TableLayer.test.js.map +0 -1
- package/dist/__tests__/exports.test.d.ts +0 -2
- package/dist/__tests__/exports.test.d.ts.map +0 -1
- package/dist/__tests__/exports.test.js +0 -48
- package/dist/__tests__/exports.test.js.map +0 -1
- package/dist/hooks/AudioProvider.d.ts +0 -71
- package/dist/hooks/AudioProvider.d.ts.map +0 -1
- package/dist/hooks/AudioProvider.js +0 -52
- package/dist/hooks/AudioProvider.js.map +0 -1
- package/dist/hooks/MediaContext.d.ts +0 -35
- package/dist/hooks/MediaContext.d.ts.map +0 -1
- package/dist/hooks/MediaContext.js +0 -72
- package/dist/hooks/MediaContext.js.map +0 -1
- package/dist/hooks/index.d.ts +0 -6
- package/dist/hooks/index.d.ts.map +0 -1
- package/dist/hooks/index.js +0 -5
- package/dist/hooks/index.js.map +0 -1
- package/dist/hooks/useAudioSync.d.ts +0 -18
- package/dist/hooks/useAudioSync.d.ts.map +0 -1
- package/dist/hooks/useAudioSync.js +0 -340
- package/dist/hooks/useAudioSync.js.map +0 -1
- package/dist/hooks/useAutoSurface.d.ts +0 -11
- package/dist/hooks/useAutoSurface.d.ts.map +0 -1
- package/dist/hooks/useAutoSurface.js +0 -24
- package/dist/hooks/useAutoSurface.js.map +0 -1
- package/dist/hooks/useDocPlayback.d.ts +0 -47
- package/dist/hooks/useDocPlayback.d.ts.map +0 -1
- package/dist/hooks/useDocPlayback.js +0 -179
- package/dist/hooks/useDocPlayback.js.map +0 -1
- package/dist/hooks/useViewportOrientation.d.ts +0 -31
- package/dist/hooks/useViewportOrientation.d.ts.map +0 -1
- package/dist/hooks/useViewportOrientation.js +0 -92
- package/dist/hooks/useViewportOrientation.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/jsonView/JsonView.d.ts +0 -26
- package/dist/jsonView/JsonView.d.ts.map +0 -1
- package/dist/jsonView/JsonView.js +0 -12
- package/dist/jsonView/JsonView.js.map +0 -1
- package/dist/jsonView/RenderNode.d.ts +0 -22
- package/dist/jsonView/RenderNode.d.ts.map +0 -1
- package/dist/jsonView/RenderNode.js +0 -30
- package/dist/jsonView/RenderNode.js.map +0 -1
- package/dist/jsonView/index.d.ts +0 -3
- package/dist/jsonView/index.d.ts.map +0 -1
- package/dist/jsonView/index.js +0 -2
- package/dist/jsonView/index.js.map +0 -1
- package/dist/jsonView/useJsonViewTokens.d.ts +0 -14
- package/dist/jsonView/useJsonViewTokens.d.ts.map +0 -1
- package/dist/jsonView/useJsonViewTokens.js +0 -34
- package/dist/jsonView/useJsonViewTokens.js.map +0 -1
- package/dist/jsonView/viewers.d.ts +0 -30
- package/dist/jsonView/viewers.d.ts.map +0 -1
- package/dist/jsonView/viewers.js +0 -226
- package/dist/jsonView/viewers.js.map +0 -1
- package/dist/layers/ImageLayer.d.ts +0 -23
- package/dist/layers/ImageLayer.d.ts.map +0 -1
- package/dist/layers/ImageLayer.js +0 -104
- package/dist/layers/ImageLayer.js.map +0 -1
- package/dist/layers/MapLayer.d.ts +0 -29
- package/dist/layers/MapLayer.d.ts.map +0 -1
- package/dist/layers/MapLayer.js +0 -97
- package/dist/layers/MapLayer.js.map +0 -1
- package/dist/layers/ShapeLayer.d.ts +0 -20
- package/dist/layers/ShapeLayer.d.ts.map +0 -1
- package/dist/layers/ShapeLayer.js +0 -39
- package/dist/layers/ShapeLayer.js.map +0 -1
- package/dist/layers/TableLayer.d.ts +0 -23
- package/dist/layers/TableLayer.d.ts.map +0 -1
- package/dist/layers/TableLayer.js +0 -58
- package/dist/layers/TableLayer.js.map +0 -1
- package/dist/layers/TextLayer.d.ts +0 -23
- package/dist/layers/TextLayer.d.ts.map +0 -1
- package/dist/layers/TextLayer.js +0 -126
- package/dist/layers/TextLayer.js.map +0 -1
- package/dist/layers/VideoLayer.d.ts +0 -40
- package/dist/layers/VideoLayer.d.ts.map +0 -1
- package/dist/layers/VideoLayer.js +0 -105
- package/dist/layers/VideoLayer.js.map +0 -1
- package/dist/layers/index.d.ts +0 -6
- package/dist/layers/index.d.ts.map +0 -1
- package/dist/layers/index.js +0 -6
- package/dist/layers/index.js.map +0 -1
- package/dist/standalone-entry.d.ts +0 -69
- package/dist/standalone-entry.d.ts.map +0 -1
- package/dist/standalone-entry.js +0 -185
- package/dist/standalone-entry.js.map +0 -1
- package/dist/standalone-source.d.ts +0 -2
- package/dist/types.d.ts +0 -154
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -21
- package/dist/types.js.map +0 -1
- package/dist/utils/animationUtils.d.ts +0 -8
- package/dist/utils/animationUtils.d.ts.map +0 -1
- package/dist/utils/animationUtils.js +0 -8
- package/dist/utils/animationUtils.js.map +0 -1
- package/dist/utils/layerUtils.d.ts +0 -17
- package/dist/utils/layerUtils.d.ts.map +0 -1
- package/dist/utils/layerUtils.js +0 -37
- package/dist/utils/layerUtils.js.map +0 -1
- package/dist/utils/mapTileUtils.d.ts +0 -105
- package/dist/utils/mapTileUtils.d.ts.map +0 -1
- package/dist/utils/mapTileUtils.js +0 -268
- package/dist/utils/mapTileUtils.js.map +0 -1
package/dist/jsonView/viewers.js
DELETED
|
@@ -1,226 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* Read-only viewer renderers for `<JsonView>`. Each viewer is a small
|
|
4
|
-
* pure function that takes a value + schema slice and renders inline.
|
|
5
|
-
* Group / card-stack viewers recurse into `RenderNode`.
|
|
6
|
-
*/
|
|
7
|
-
import { Fragment, useMemo } from 'react';
|
|
8
|
-
import { arrayItemKind, } from '@bendyline/squisq/jsonForm';
|
|
9
|
-
import { parseMarkdown } from '@bendyline/squisq/markdown';
|
|
10
|
-
import { MarkdownRenderer } from '../MarkdownRenderer';
|
|
11
|
-
import { RenderNode } from './RenderNode';
|
|
12
|
-
// ── Primitive viewers ──────────────────────────────────────────────
|
|
13
|
-
export function TextViewer({ value }) {
|
|
14
|
-
if (value === undefined || value === null || value === '') {
|
|
15
|
-
return _jsx("span", { className: "squisq-jv-empty", children: "\u2014" });
|
|
16
|
-
}
|
|
17
|
-
return _jsx("span", { className: "squisq-jv-value", children: String(value) });
|
|
18
|
-
}
|
|
19
|
-
export function MultilineViewer({ value }) {
|
|
20
|
-
if (value === undefined || value === null || value === '') {
|
|
21
|
-
return _jsx("span", { className: "squisq-jv-empty", children: "\u2014" });
|
|
22
|
-
}
|
|
23
|
-
return _jsx("span", { className: "squisq-jv-value squisq-jv-value--multiline", children: String(value) });
|
|
24
|
-
}
|
|
25
|
-
export function RichTextViewer({ value }) {
|
|
26
|
-
const nodes = useMemo(() => {
|
|
27
|
-
if (typeof value !== 'string' || value === '')
|
|
28
|
-
return null;
|
|
29
|
-
try {
|
|
30
|
-
const doc = parseMarkdown(value);
|
|
31
|
-
return doc.children;
|
|
32
|
-
}
|
|
33
|
-
catch {
|
|
34
|
-
return null;
|
|
35
|
-
}
|
|
36
|
-
}, [value]);
|
|
37
|
-
if (!nodes)
|
|
38
|
-
return _jsx("span", { className: "squisq-jv-empty", children: "\u2014" });
|
|
39
|
-
return (_jsx("div", { className: "squisq-jv-richtext", children: _jsx(MarkdownRenderer, { nodes: nodes }) }));
|
|
40
|
-
}
|
|
41
|
-
export function NumberViewer({ value }) {
|
|
42
|
-
if (value === undefined || value === null) {
|
|
43
|
-
return _jsx("span", { className: "squisq-jv-empty", children: "\u2014" });
|
|
44
|
-
}
|
|
45
|
-
return _jsx("span", { className: "squisq-jv-value", children: String(value) });
|
|
46
|
-
}
|
|
47
|
-
export function BooleanViewer({ value }) {
|
|
48
|
-
const on = Boolean(value);
|
|
49
|
-
return (_jsx("span", { className: `squisq-jv-toggle squisq-jv-toggle--${on ? 'on' : 'off'}`, children: on ? 'On' : 'Off' }));
|
|
50
|
-
}
|
|
51
|
-
export function EnumViewer({ value, schema }) {
|
|
52
|
-
if (value === undefined || value === null || value === '') {
|
|
53
|
-
return _jsx("span", { className: "squisq-jv-empty", children: "\u2014" });
|
|
54
|
-
}
|
|
55
|
-
const labels = schema.squisq?.enumLabels;
|
|
56
|
-
const display = labels && typeof value === 'string' ? (labels[value] ?? value) : String(value);
|
|
57
|
-
return _jsx("span", { className: "squisq-jv-value", children: display });
|
|
58
|
-
}
|
|
59
|
-
export function ColorViewer({ value }) {
|
|
60
|
-
if (typeof value !== 'string' || value === '') {
|
|
61
|
-
return _jsx("span", { className: "squisq-jv-empty", children: "\u2014" });
|
|
62
|
-
}
|
|
63
|
-
return (_jsxs("span", { className: "squisq-jv-color", children: [_jsx("span", { className: "squisq-jv-color__swatch", style: { background: value }, "aria-hidden": true }), _jsx("span", { className: "squisq-jv-color__hex", children: value })] }));
|
|
64
|
-
}
|
|
65
|
-
export function DateViewer({ value, schema }) {
|
|
66
|
-
if (typeof value !== 'string' || value === '') {
|
|
67
|
-
return _jsx("span", { className: "squisq-jv-empty", children: "\u2014" });
|
|
68
|
-
}
|
|
69
|
-
const fmt = schema.format;
|
|
70
|
-
let display = value;
|
|
71
|
-
try {
|
|
72
|
-
const date = new Date(value);
|
|
73
|
-
if (!Number.isNaN(date.getTime())) {
|
|
74
|
-
if (fmt === 'time') {
|
|
75
|
-
display = date.toLocaleTimeString();
|
|
76
|
-
}
|
|
77
|
-
else if (fmt === 'date') {
|
|
78
|
-
display = date.toLocaleDateString();
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
display = date.toLocaleString();
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
catch {
|
|
86
|
-
/* fall through to raw value */
|
|
87
|
-
}
|
|
88
|
-
return _jsx("span", { className: "squisq-jv-value", children: display });
|
|
89
|
-
}
|
|
90
|
-
// ── Composite viewers ─────────────────────────────────────────────
|
|
91
|
-
export function ChipBinViewer({ value, schema }) {
|
|
92
|
-
if (!Array.isArray(value) || value.length === 0) {
|
|
93
|
-
return _jsx("span", { className: "squisq-jv-empty", children: "\u2014" });
|
|
94
|
-
}
|
|
95
|
-
const itemSchema = Array.isArray(schema.items) ? schema.items[0] : schema.items;
|
|
96
|
-
const labels = itemSchema?.squisq?.enumLabels;
|
|
97
|
-
return (_jsx("div", { className: "squisq-jv-chip-bin", children: value.map((item, i) => {
|
|
98
|
-
const label = labels && typeof item === 'string' ? (labels[item] ?? String(item)) : String(item);
|
|
99
|
-
return (_jsx("span", { className: "squisq-jv-chip", children: label }, i));
|
|
100
|
-
}) }));
|
|
101
|
-
}
|
|
102
|
-
export function CardStackViewer(props) {
|
|
103
|
-
const { value, schema, rootSchema, rootData, pointer, density } = props;
|
|
104
|
-
if (!Array.isArray(value) || value.length === 0) {
|
|
105
|
-
return _jsx("span", { className: "squisq-jv-empty", children: "No items" });
|
|
106
|
-
}
|
|
107
|
-
const itemSchema = (Array.isArray(schema.items) ? schema.items[0] : schema.items) ?? {};
|
|
108
|
-
const itemLabel = itemSchema.squisq?.itemLabel;
|
|
109
|
-
return (_jsx("div", { className: "squisq-jv-card-stack", children: value.map((item, i) => {
|
|
110
|
-
const title = resolveItemTitle(itemLabel, item, i);
|
|
111
|
-
return (_jsxs("div", { className: "squisq-jv-card", children: [title ? _jsx("h4", { className: "squisq-jv-card__title", children: title }) : null, _jsx(RenderNode, { value: item, schema: itemSchema, rootSchema: rootSchema, rootData: rootData, pointer: `${pointer}/${i}`, density: density, suppressTopGroupTitle: true })] }, i));
|
|
112
|
-
}) }));
|
|
113
|
-
}
|
|
114
|
-
function resolveItemTitle(spec, item, index) {
|
|
115
|
-
if (!spec)
|
|
116
|
-
return `Item ${index + 1}`;
|
|
117
|
-
if (typeof spec === 'string')
|
|
118
|
-
return spec;
|
|
119
|
-
if (item && typeof item === 'object') {
|
|
120
|
-
const v = item[spec.fromField];
|
|
121
|
-
if (typeof v === 'string' && v !== '')
|
|
122
|
-
return v;
|
|
123
|
-
if (typeof v === 'number')
|
|
124
|
-
return String(v);
|
|
125
|
-
}
|
|
126
|
-
return `Item ${index + 1}`;
|
|
127
|
-
}
|
|
128
|
-
export function GroupViewer(props) {
|
|
129
|
-
const { value, schema, rootSchema, rootData, pointer, density, suppressTitle } = props;
|
|
130
|
-
const title = !suppressTitle ? (schema.squisq?.label ?? schema.title) : undefined;
|
|
131
|
-
const help = schema.squisq?.help ?? schema.description;
|
|
132
|
-
const obj = (value && typeof value === 'object' ? value : {}) ?? {};
|
|
133
|
-
const propEntries = Object.entries(schema.properties ?? {});
|
|
134
|
-
return (_jsxs("section", { className: "squisq-jv-group", children: [title ? _jsx("h3", { className: "squisq-jv-group__title", children: title }) : null, help ? _jsx("p", { className: "squisq-jv-group__help", children: help }) : null, propEntries.map(([key, propSchema]) => (_jsx(Fragment, { children: _jsx(RowOrSection, { label: propSchema.squisq?.label ?? propSchema.title ?? key, help: propSchema.squisq?.help ?? propSchema.description, kindHint: propSchema, children: _jsx(RenderNode, { value: obj[key], schema: propSchema, rootSchema: rootSchema, rootData: rootData, pointer: `${pointer}/${key}`, density: density, suppressTopGroupTitle: true }) }) }, key)))] }));
|
|
135
|
-
}
|
|
136
|
-
/**
|
|
137
|
-
* Decide whether to use the inline label/value Row layout, or to drop
|
|
138
|
-
* the row chrome entirely (for nested groups, card-stacks, richtext —
|
|
139
|
-
* which present their own headings).
|
|
140
|
-
*/
|
|
141
|
-
function RowOrSection({ label, help, kindHint, children, }) {
|
|
142
|
-
const composite = isCompositeKind(kindHint);
|
|
143
|
-
if (composite) {
|
|
144
|
-
return _jsx(_Fragment, { children: children });
|
|
145
|
-
}
|
|
146
|
-
return (_jsxs("div", { className: "squisq-jv-row", children: [_jsx("div", { className: "squisq-jv-label", title: help, children: label }), _jsx("div", { children: children })] }));
|
|
147
|
-
}
|
|
148
|
-
function isCompositeKind(schema) {
|
|
149
|
-
const t = schema.type;
|
|
150
|
-
const arrayLike = t === 'array' || (Array.isArray(t) && t.includes('array'));
|
|
151
|
-
if (arrayLike) {
|
|
152
|
-
return arrayItemKind(schema) === 'object';
|
|
153
|
-
}
|
|
154
|
-
const objectLike = t === 'object' || (Array.isArray(t) && t.includes('object'));
|
|
155
|
-
if (objectLike)
|
|
156
|
-
return true;
|
|
157
|
-
if (schema.oneOf || schema.anyOf)
|
|
158
|
-
return true;
|
|
159
|
-
if (schema.format === 'markdown' || schema.squisq?.control === 'richtext')
|
|
160
|
-
return true;
|
|
161
|
-
return false;
|
|
162
|
-
}
|
|
163
|
-
export function TabsViewer(props) {
|
|
164
|
-
const { value, schema, rootSchema, rootData, pointer, density } = props;
|
|
165
|
-
const branches = (schema.oneOf ?? schema.anyOf ?? []).slice();
|
|
166
|
-
const matchedIndex = pickMatchingBranch(branches, value);
|
|
167
|
-
const branch = branches[matchedIndex];
|
|
168
|
-
if (!branch) {
|
|
169
|
-
return _jsx(TextViewer, { ...props });
|
|
170
|
-
}
|
|
171
|
-
return (_jsxs("div", { className: "squisq-jv-tabs", children: [_jsx("span", { className: "squisq-jv-tabs__discriminator", children: branch.squisq?.label ?? branch.title ?? `Option ${matchedIndex + 1}` }), _jsx(RenderNode, { value: value, schema: branch, rootSchema: rootSchema, rootData: rootData, pointer: pointer, density: density })] }));
|
|
172
|
-
}
|
|
173
|
-
function pickMatchingBranch(branches, value) {
|
|
174
|
-
for (let i = 0; i < branches.length; i++) {
|
|
175
|
-
if (matchesShape(branches[i], value))
|
|
176
|
-
return i;
|
|
177
|
-
}
|
|
178
|
-
return 0;
|
|
179
|
-
}
|
|
180
|
-
function matchesShape(schema, value) {
|
|
181
|
-
const t = schema.type;
|
|
182
|
-
const target = Array.isArray(t) ? t.find((x) => x !== 'null') : t;
|
|
183
|
-
if (!target)
|
|
184
|
-
return true;
|
|
185
|
-
switch (target) {
|
|
186
|
-
case 'string':
|
|
187
|
-
return typeof value === 'string';
|
|
188
|
-
case 'number':
|
|
189
|
-
case 'integer':
|
|
190
|
-
return typeof value === 'number';
|
|
191
|
-
case 'boolean':
|
|
192
|
-
return typeof value === 'boolean';
|
|
193
|
-
case 'null':
|
|
194
|
-
return value === null;
|
|
195
|
-
case 'array':
|
|
196
|
-
return Array.isArray(value);
|
|
197
|
-
case 'object':
|
|
198
|
-
return value !== null && typeof value === 'object' && !Array.isArray(value);
|
|
199
|
-
default:
|
|
200
|
-
return false;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
// ── Registry ──────────────────────────────────────────────────────
|
|
204
|
-
// eslint-disable-next-line react-refresh/only-export-components
|
|
205
|
-
export const VIEWERS = {
|
|
206
|
-
text: TextViewer,
|
|
207
|
-
multiline: MultilineViewer,
|
|
208
|
-
richtext: RichTextViewer,
|
|
209
|
-
color: ColorViewer,
|
|
210
|
-
date: DateViewer,
|
|
211
|
-
time: DateViewer,
|
|
212
|
-
datetime: DateViewer,
|
|
213
|
-
slider: NumberViewer,
|
|
214
|
-
stepper: NumberViewer,
|
|
215
|
-
segmented: EnumViewer,
|
|
216
|
-
radio: EnumViewer,
|
|
217
|
-
combobox: EnumViewer,
|
|
218
|
-
toggle: BooleanViewer,
|
|
219
|
-
checkbox: BooleanViewer,
|
|
220
|
-
card: GroupViewer,
|
|
221
|
-
group: GroupViewer,
|
|
222
|
-
'card-stack': CardStackViewer,
|
|
223
|
-
'chip-bin': ChipBinViewer,
|
|
224
|
-
tabs: TabsViewer,
|
|
225
|
-
};
|
|
226
|
-
//# sourceMappingURL=viewers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"viewers.js","sourceRoot":"","sources":["../../src/jsonView/viewers.tsx"],"names":[],"mappings":";AAAA;;;;GAIG;AAEH,OAAO,EAAE,QAAQ,EAAE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,gEAAgE;AAChE,MAAM,CAAC,MAAM,OAAO,GAA0D;IAC5E,IAAI,EAAE,UAAU;IAChB,SAAS,EAAE,eAAe;IAC1B,QAAQ,EAAE,cAAc;IACxB,KAAK,EAAE,WAAW;IAClB,IAAI,EAAE,UAAU;IAChB,IAAI,EAAE,UAAU;IAChB,QAAQ,EAAE,UAAU;IACpB,MAAM,EAAE,YAAY;IACpB,OAAO,EAAE,YAAY;IACrB,SAAS,EAAE,UAAU;IACrB,KAAK,EAAE,UAAU;IACjB,QAAQ,EAAE,UAAU;IACpB,MAAM,EAAE,aAAa;IACrB,QAAQ,EAAE,aAAa;IACvB,IAAI,EAAE,WAAW;IACjB,KAAK,EAAE,WAAW;IAClB,YAAY,EAAE,eAAe;IAC7B,UAAU,EAAE,aAAa;IACzB,IAAI,EAAE,UAAU;CACjB,CAAC"}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ImageLayer Component
|
|
3
|
-
*
|
|
4
|
-
* Renders an image layer within an SVG block. Supports Ken Burns and other
|
|
5
|
-
* animations via CSS classes. Images are rendered using SVG <image> element
|
|
6
|
-
* with proper aspect ratio handling.
|
|
7
|
-
*/
|
|
8
|
-
import type { ImageLayer as ImageLayerType } from '@bendyline/squisq/schemas';
|
|
9
|
-
interface ImageLayerProps {
|
|
10
|
-
layer: ImageLayerType;
|
|
11
|
-
/** Base path for resolving relative image URLs */
|
|
12
|
-
basePath: string;
|
|
13
|
-
/** Viewport dimensions for percentage calculations */
|
|
14
|
-
viewport: {
|
|
15
|
-
width: number;
|
|
16
|
-
height: number;
|
|
17
|
-
};
|
|
18
|
-
/** Current time relative to block start (for animation timing) */
|
|
19
|
-
blockTime: number;
|
|
20
|
-
}
|
|
21
|
-
export declare function ImageLayer({ layer, basePath, viewport, blockTime }: ImageLayerProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
-
export default ImageLayer;
|
|
23
|
-
//# sourceMappingURL=ImageLayer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ImageLayer.d.ts","sourceRoot":"","sources":["../../src/layers/ImageLayer.tsx"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,UAAU,IAAI,cAAc,EAAa,MAAM,2BAA2B,CAAC;AAKzF,UAAU,eAAe;IACvB,KAAK,EAAE,cAAc,CAAC;IACtB,kDAAkD;IAClD,QAAQ,EAAE,MAAM,CAAC;IACjB,sDAAsD;IACtD,QAAQ,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5C,kEAAkE;IAClE,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,eAAe,2CA+GnF;AA+CD,eAAe,UAAU,CAAC"}
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import { getAnimationStyle } from '../utils/animationUtils';
|
|
3
|
-
import { resolveValue, getAnchorOffset } from '../utils/layerUtils';
|
|
4
|
-
import { useMediaUrl } from '../hooks/MediaContext';
|
|
5
|
-
export function ImageLayer({ layer, basePath, viewport, blockTime }) {
|
|
6
|
-
const { content, position, animation } = layer;
|
|
7
|
-
// Resolve position values to pixels
|
|
8
|
-
const x = resolveValue(position.x, viewport.width);
|
|
9
|
-
const y = resolveValue(position.y, viewport.height);
|
|
10
|
-
const width = position.width ? resolveValue(position.width, viewport.width) : viewport.width;
|
|
11
|
-
const height = position.height ? resolveValue(position.height, viewport.height) : viewport.height;
|
|
12
|
-
// Apply anchor offset
|
|
13
|
-
const offset = getAnchorOffset(position.anchor, width, height);
|
|
14
|
-
const finalX = x + offset.x;
|
|
15
|
-
const finalY = y + offset.y;
|
|
16
|
-
// Resolve image URL via MediaProvider (if available), falling back to basePath
|
|
17
|
-
const src = useMediaUrl(content.src, basePath);
|
|
18
|
-
// Get animation styles
|
|
19
|
-
const animStyle = getAnimationStyle(animation, blockTime);
|
|
20
|
-
// SVG preserveAspectRatio based on fit mode
|
|
21
|
-
const preserveAspectRatio = getPreserveAspectRatio(content.fit);
|
|
22
|
-
const isCover = content.fit === 'cover';
|
|
23
|
-
// Detect spatial (transform-based) animations that need Ken Burns treatment.
|
|
24
|
-
// These animations should move the image *content* within fixed bounds rather
|
|
25
|
-
// than shifting the entire image container.
|
|
26
|
-
const isSpatialAnim = animation && SPATIAL_ANIMATION_TYPES.has(animation.type);
|
|
27
|
-
// Ken Burns mode: cover image with spatial animation.
|
|
28
|
-
// Keep the container static, animate the inner <img> within clipped bounds.
|
|
29
|
-
if (isCover && isSpatialAnim && animation) {
|
|
30
|
-
const kbAnim = remapToKenBurns(animation);
|
|
31
|
-
const kbStyle = getAnimationStyle(kbAnim, blockTime);
|
|
32
|
-
return (_jsx("g", { className: "block-layer block-layer--image", "data-layer-id": layer.id, children: _jsx("foreignObject", { x: finalX, y: finalY, width: width, height: height, children: _jsx("div", { style: {
|
|
33
|
-
width: `${width}px`,
|
|
34
|
-
height: `${height}px`,
|
|
35
|
-
overflow: 'hidden',
|
|
36
|
-
}, children: _jsx("img", { src: src, alt: content.alt || '', className: kbStyle.className, style: {
|
|
37
|
-
width: `${width}px`,
|
|
38
|
-
height: `${height}px`,
|
|
39
|
-
objectFit: 'cover',
|
|
40
|
-
objectPosition: 'center',
|
|
41
|
-
display: 'block',
|
|
42
|
-
pointerEvents: 'none',
|
|
43
|
-
transformOrigin: 'center center',
|
|
44
|
-
...kbStyle.style,
|
|
45
|
-
} }) }) }) }));
|
|
46
|
-
}
|
|
47
|
-
// For cover mode, use foreignObject with CSS object-fit for more reliable coverage
|
|
48
|
-
// SVG's preserveAspectRatio can be inconsistent across browsers
|
|
49
|
-
if (isCover) {
|
|
50
|
-
return (_jsx("g", { className: `block-layer block-layer--image ${animStyle.className}`, style: animStyle.style, "data-layer-id": layer.id, children: _jsx("foreignObject", { x: finalX, y: finalY, width: width, height: height, children: _jsx("img", { src: src, alt: content.alt || '', style: {
|
|
51
|
-
width: `${width}px`,
|
|
52
|
-
height: `${height}px`,
|
|
53
|
-
objectFit: 'cover',
|
|
54
|
-
objectPosition: 'center',
|
|
55
|
-
display: 'block',
|
|
56
|
-
pointerEvents: 'none',
|
|
57
|
-
} }) }) }));
|
|
58
|
-
}
|
|
59
|
-
// For contain/fill modes, use SVG image element
|
|
60
|
-
return (_jsx("g", { className: `block-layer block-layer--image ${animStyle.className}`, style: animStyle.style, "data-layer-id": layer.id, children: _jsx("image", { href: src, x: finalX, y: finalY, width: width, height: height, preserveAspectRatio: preserveAspectRatio, style: { pointerEvents: 'none' } }) }));
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Map fit mode to SVG preserveAspectRatio.
|
|
64
|
-
*/
|
|
65
|
-
function getPreserveAspectRatio(fit) {
|
|
66
|
-
switch (fit) {
|
|
67
|
-
case 'cover':
|
|
68
|
-
return 'xMidYMid slice';
|
|
69
|
-
case 'fill':
|
|
70
|
-
return 'none';
|
|
71
|
-
case 'contain':
|
|
72
|
-
default:
|
|
73
|
-
return 'xMidYMid meet';
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
// ============================================
|
|
77
|
-
// Ken Burns Helpers
|
|
78
|
-
// ============================================
|
|
79
|
-
/** Animation types that use CSS transforms (translate/scale). */
|
|
80
|
-
const SPATIAL_ANIMATION_TYPES = new Set(['panLeft', 'panRight', 'slowZoom', 'zoomIn', 'zoomOut']);
|
|
81
|
-
/**
|
|
82
|
-
* Remap animation for Ken Burns inner-image rendering.
|
|
83
|
-
*
|
|
84
|
-
* Pure pan animations (panLeft/panRight) get remapped to combined slowZoom+pan
|
|
85
|
-
* to maintain minimum scale and avoid revealing gaps at image edges.
|
|
86
|
-
* zoomIn/zoomOut get remapped to slowZoom variants (no opacity change, which
|
|
87
|
-
* is inappropriate for sustained ambient motion).
|
|
88
|
-
*/
|
|
89
|
-
function remapToKenBurns(anim) {
|
|
90
|
-
switch (anim.type) {
|
|
91
|
-
case 'panLeft':
|
|
92
|
-
return { ...anim, type: 'slowZoom', panDirection: 'left' };
|
|
93
|
-
case 'panRight':
|
|
94
|
-
return { ...anim, type: 'slowZoom', panDirection: 'right' };
|
|
95
|
-
case 'zoomIn':
|
|
96
|
-
return { ...anim, type: 'slowZoom', direction: 'in' };
|
|
97
|
-
case 'zoomOut':
|
|
98
|
-
return { ...anim, type: 'slowZoom', direction: 'out' };
|
|
99
|
-
default:
|
|
100
|
-
return anim; // slowZoom variants are already correct
|
|
101
|
-
}
|
|
102
|
-
}
|
|
103
|
-
export default ImageLayer;
|
|
104
|
-
//# sourceMappingURL=ImageLayer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ImageLayer.js","sourceRoot":"","sources":["../../src/layers/ImageLayer.tsx"],"names":[],"mappings":";AASA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAYpD,MAAM,UAAU,UAAU,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAmB;IAClF,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IAE/C,oCAAoC;IACpC,MAAM,CAAC,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;IACnD,MAAM,CAAC,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IACpD,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,KAAK,CA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,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,SAAS,EAAE,KAAK,EAAE,CAAC;QACzD;YACE,OAAO,IAAI,CAAC,CAAC,wCAAwC;IACzD,CAAC;AACH,CAAC;AAED,eAAe,UAAU,CAAC"}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* MapLayer Component
|
|
3
|
-
*
|
|
4
|
-
* Renders a geographic map layer within an SVG block. Maps are composed from
|
|
5
|
-
* static tile images fetched from free/open-source providers.
|
|
6
|
-
*
|
|
7
|
-
* For video export reliability, maps can use pre-rendered static images via
|
|
8
|
-
* the staticSrc property, avoiding tile loading race conditions during capture.
|
|
9
|
-
*
|
|
10
|
-
* Tile fetching: Tiles are loaded on mount and composited into a data URL
|
|
11
|
-
* for SVG embedding. This ensures correct rendering in both browser and
|
|
12
|
-
* Playwright screenshot contexts.
|
|
13
|
-
*/
|
|
14
|
-
import type { MapLayer as MapLayerType } from '@bendyline/squisq/schemas';
|
|
15
|
-
interface MapLayerProps {
|
|
16
|
-
layer: MapLayerType;
|
|
17
|
-
/** Base path for resolving relative image URLs */
|
|
18
|
-
basePath: string;
|
|
19
|
-
/** Viewport dimensions for percentage calculations */
|
|
20
|
-
viewport: {
|
|
21
|
-
width: number;
|
|
22
|
-
height: number;
|
|
23
|
-
};
|
|
24
|
-
/** Current time relative to block start (for animation timing) */
|
|
25
|
-
blockTime: number;
|
|
26
|
-
}
|
|
27
|
-
export declare function MapLayer({ layer, basePath, viewport, blockTime }: MapLayerProps): import("react/jsx-runtime").JSX.Element;
|
|
28
|
-
export default MapLayer;
|
|
29
|
-
//# sourceMappingURL=MapLayer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MapLayer.d.ts","sourceRoot":"","sources":["../../src/layers/MapLayer.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,KAAK,EAAE,QAAQ,IAAI,YAAY,EAAE,MAAM,2BAA2B,CAAC;AAK1E,UAAU,aAAa;IACrB,KAAK,EAAE,YAAY,CAAC;IACpB,kDAAkD;IAClD,QAAQ,EAAE,MAAM,CAAC;IACjB,sDAAsD;IACtD,QAAQ,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5C,kEAAkE;IAClE,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,QAAQ,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,aAAa,2CAuJ/E;AAED,eAAe,QAAQ,CAAC"}
|
package/dist/layers/MapLayer.js
DELETED
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
/**
|
|
3
|
-
* MapLayer Component
|
|
4
|
-
*
|
|
5
|
-
* Renders a geographic map layer within an SVG block. Maps are composed from
|
|
6
|
-
* static tile images fetched from free/open-source providers.
|
|
7
|
-
*
|
|
8
|
-
* For video export reliability, maps can use pre-rendered static images via
|
|
9
|
-
* the staticSrc property, avoiding tile loading race conditions during capture.
|
|
10
|
-
*
|
|
11
|
-
* Tile fetching: Tiles are loaded on mount and composited into a data URL
|
|
12
|
-
* for SVG embedding. This ensures correct rendering in both browser and
|
|
13
|
-
* Playwright screenshot contexts.
|
|
14
|
-
*/
|
|
15
|
-
import { useState, useEffect } from 'react';
|
|
16
|
-
import { getAnimationStyle } from '../utils/animationUtils';
|
|
17
|
-
import { resolveValue, getAnchorOffset } from '../utils/layerUtils';
|
|
18
|
-
import { composeMapImage } from '../utils/mapTileUtils';
|
|
19
|
-
export function MapLayer({ layer, basePath, viewport, blockTime }) {
|
|
20
|
-
const { content, position, animation } = layer;
|
|
21
|
-
const [mapImageUrl, setMapImageUrl] = useState(null);
|
|
22
|
-
const [isLoading, setIsLoading] = useState(true);
|
|
23
|
-
const [error, setError] = useState(null);
|
|
24
|
-
// Resolve position values to pixels
|
|
25
|
-
const x = resolveValue(position.x, viewport.width);
|
|
26
|
-
const y = resolveValue(position.y, viewport.height);
|
|
27
|
-
const width = position.width ? resolveValue(position.width, viewport.width) : viewport.width;
|
|
28
|
-
const height = position.height ? resolveValue(position.height, viewport.height) : viewport.height;
|
|
29
|
-
// Apply anchor offset
|
|
30
|
-
const offset = getAnchorOffset(position.anchor, width, height);
|
|
31
|
-
const finalX = x + offset.x;
|
|
32
|
-
const finalY = y + offset.y;
|
|
33
|
-
// Use static image if provided, otherwise fetch and compose tiles
|
|
34
|
-
useEffect(() => {
|
|
35
|
-
let cancelled = false;
|
|
36
|
-
if (content.staticSrc) {
|
|
37
|
-
// Use pre-rendered static image
|
|
38
|
-
const src = content.staticSrc.startsWith('http')
|
|
39
|
-
? content.staticSrc
|
|
40
|
-
: `${basePath}/${content.staticSrc}`;
|
|
41
|
-
setMapImageUrl(src);
|
|
42
|
-
setIsLoading(false);
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
// Compose map from tiles
|
|
46
|
-
setIsLoading(true);
|
|
47
|
-
setError(null);
|
|
48
|
-
composeMapImage({
|
|
49
|
-
center: content.center,
|
|
50
|
-
zoom: content.zoom,
|
|
51
|
-
style: content.style,
|
|
52
|
-
width,
|
|
53
|
-
height,
|
|
54
|
-
markers: content.markers,
|
|
55
|
-
showAttribution: content.showAttribution !== false,
|
|
56
|
-
})
|
|
57
|
-
.then((dataUrl) => {
|
|
58
|
-
if (!cancelled) {
|
|
59
|
-
setMapImageUrl(dataUrl);
|
|
60
|
-
setIsLoading(false);
|
|
61
|
-
}
|
|
62
|
-
})
|
|
63
|
-
.catch((err) => {
|
|
64
|
-
if (!cancelled) {
|
|
65
|
-
console.error('Failed to compose map:', err);
|
|
66
|
-
setError(err instanceof Error ? err.message : String(err));
|
|
67
|
-
setIsLoading(false);
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
return () => {
|
|
71
|
-
cancelled = true;
|
|
72
|
-
};
|
|
73
|
-
// eslint-disable-next-line react-hooks/exhaustive-deps -- content properties are destructured below; center/markers/showAttribution are stable per-render
|
|
74
|
-
}, [
|
|
75
|
-
content.center.lat,
|
|
76
|
-
content.center.lng,
|
|
77
|
-
content.zoom,
|
|
78
|
-
content.style,
|
|
79
|
-
content.staticSrc,
|
|
80
|
-
width,
|
|
81
|
-
height,
|
|
82
|
-
basePath,
|
|
83
|
-
]);
|
|
84
|
-
// Get animation styles
|
|
85
|
-
const animStyle = getAnimationStyle(animation, blockTime);
|
|
86
|
-
// Render loading state
|
|
87
|
-
if (isLoading) {
|
|
88
|
-
return (_jsxs("g", { className: `block-layer block-layer--map ${animStyle.className}`, style: animStyle.style, "data-layer-id": layer.id, children: [_jsx("rect", { x: finalX, y: finalY, width: width, height: height, fill: "#e5e7eb" }), _jsx("text", { x: finalX + width / 2, y: finalY + height / 2, textAnchor: "middle", dominantBaseline: "middle", fill: "#9ca3af", fontSize: "24", fontFamily: "system-ui, sans-serif", children: "Loading map..." })] }));
|
|
89
|
-
}
|
|
90
|
-
// Render error state
|
|
91
|
-
if (error || !mapImageUrl) {
|
|
92
|
-
return (_jsxs("g", { className: `block-layer block-layer--map ${animStyle.className}`, style: animStyle.style, "data-layer-id": layer.id, children: [_jsx("rect", { x: finalX, y: finalY, width: width, height: height, fill: "#fef2f2" }), _jsx("text", { x: finalX + width / 2, y: finalY + height / 2, textAnchor: "middle", dominantBaseline: "middle", fill: "#dc2626", fontSize: "18", fontFamily: "system-ui, sans-serif", children: "Map failed to load" })] }));
|
|
93
|
-
}
|
|
94
|
-
return (_jsxs("g", { className: `block-layer block-layer--map ${animStyle.className}`, style: animStyle.style, "data-layer-id": layer.id, children: [_jsx("defs", { children: _jsx("clipPath", { id: `clip-${layer.id}`, children: _jsx("rect", { x: finalX, y: finalY, width: width, height: height }) }) }), _jsx("g", { clipPath: `url(#clip-${layer.id})`, children: _jsx("image", { href: mapImageUrl, x: finalX, y: finalY, width: width, height: height, preserveAspectRatio: "xMidYMid slice", style: { pointerEvents: 'none' } }) })] }));
|
|
95
|
-
}
|
|
96
|
-
export default MapLayer;
|
|
97
|
-
//# sourceMappingURL=MapLayer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MapLayer.js","sourceRoot":"","sources":["../../src/layers/MapLayer.tsx"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AACpE,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAYxD,MAAM,UAAU,QAAQ,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,SAAS,EAAiB;IAC9E,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IAC/C,MAAM,CAAC,WAAW,EAAE,cAAc,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IACpE,MAAM,CAAC,SAAS,EAAE,YAAY,CAAC,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC;IACjD,MAAM,CAAC,KAAK,EAAE,QAAQ,CAAC,GAAG,QAAQ,CAAgB,IAAI,CAAC,CAAC;IAExD,oCAAoC;IACpC,MAAM,CAAC,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;IACnD,MAAM,CAAC,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IACpD,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,YAAY,CAAC,QAAQ,CAAC,KAAK,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,CAA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AAM,EACd,mBAAmB,EAAC,gBAAgB,EACpC,KAAK,EAAE,EAAE,aAAa,EAAE,MAAM,EAAE,GAChC,GACA,IACF,CACL,CAAC;AACJ,CAAC;AAED,eAAe,QAAQ,CAAC"}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* ShapeLayer Component
|
|
3
|
-
*
|
|
4
|
-
* Renders simple geometric shapes (rect, circle, line) within an SVG block.
|
|
5
|
-
* Useful for visual accents, dividers, and background elements.
|
|
6
|
-
*/
|
|
7
|
-
import type { ShapeLayer as ShapeLayerType } from '@bendyline/squisq/schemas';
|
|
8
|
-
interface ShapeLayerProps {
|
|
9
|
-
layer: ShapeLayerType;
|
|
10
|
-
/** Viewport dimensions for percentage calculations */
|
|
11
|
-
viewport: {
|
|
12
|
-
width: number;
|
|
13
|
-
height: number;
|
|
14
|
-
};
|
|
15
|
-
/** Current time relative to block start */
|
|
16
|
-
blockTime: number;
|
|
17
|
-
}
|
|
18
|
-
export declare function ShapeLayer({ layer, viewport, blockTime }: ShapeLayerProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
-
export default ShapeLayer;
|
|
20
|
-
//# sourceMappingURL=ShapeLayer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ShapeLayer.d.ts","sourceRoot":"","sources":["../../src/layers/ShapeLayer.tsx"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAI9E,UAAU,eAAe;IACvB,KAAK,EAAE,cAAc,CAAC;IACtB,sDAAsD;IACtD,QAAQ,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5C,2CAA2C;IAC3C,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,eAAe,2CA0FzE;AAED,eAAe,UAAU,CAAC"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { getAnimationStyle } from '../utils/animationUtils';
|
|
3
|
-
import { resolveValue, getAnchorOffset } from '../utils/layerUtils';
|
|
4
|
-
export function ShapeLayer({ layer, viewport, blockTime }) {
|
|
5
|
-
const { content, position, animation } = layer;
|
|
6
|
-
// Resolve position values to pixels
|
|
7
|
-
const rawX = resolveValue(position.x, viewport.width);
|
|
8
|
-
const rawY = resolveValue(position.y, viewport.height);
|
|
9
|
-
const width = position.width ? resolveValue(position.width, viewport.width) : 100;
|
|
10
|
-
const height = position.height ? resolveValue(position.height, viewport.height) : 100;
|
|
11
|
-
// Apply anchor offset (e.g., 'center' shifts x by -width/2 and y by -height/2)
|
|
12
|
-
const anchorOffset = getAnchorOffset(position.anchor, width, height);
|
|
13
|
-
const x = rawX + anchorOffset.x;
|
|
14
|
-
const y = rawY + anchorOffset.y;
|
|
15
|
-
// Get animation styles
|
|
16
|
-
const animStyle = getAnimationStyle(animation, blockTime);
|
|
17
|
-
// Check if fill is a CSS gradient (SVG rect doesn't support CSS gradients natively)
|
|
18
|
-
const fill = content.fill || 'none';
|
|
19
|
-
const isCSSGradient = typeof fill === 'string' && fill.includes('gradient(');
|
|
20
|
-
// For CSS gradients on rect, use foreignObject with an HTML div
|
|
21
|
-
if (content.shape === 'rect' && isCSSGradient) {
|
|
22
|
-
return (_jsx("g", { className: `block-layer block-layer--shape ${animStyle.className}`, style: animStyle.style, "data-layer-id": layer.id, children: _jsx("foreignObject", { x: x, y: y, width: width, height: height, children: _jsx("div", { style: {
|
|
23
|
-
width: `${width}px`,
|
|
24
|
-
height: `${height}px`,
|
|
25
|
-
background: fill,
|
|
26
|
-
borderRadius: content.borderRadius ? `${content.borderRadius}px` : undefined,
|
|
27
|
-
pointerEvents: 'none',
|
|
28
|
-
} }) }) }));
|
|
29
|
-
}
|
|
30
|
-
// Common style props for native SVG shapes
|
|
31
|
-
const shapeProps = {
|
|
32
|
-
fill: fill,
|
|
33
|
-
stroke: content.stroke,
|
|
34
|
-
strokeWidth: content.strokeWidth,
|
|
35
|
-
};
|
|
36
|
-
return (_jsxs("g", { className: `block-layer block-layer--shape ${animStyle.className}`, style: animStyle.style, "data-layer-id": layer.id, children: [content.shape === 'rect' && (_jsx("rect", { x: x, y: y, width: width, height: height, rx: content.borderRadius, ry: content.borderRadius, ...shapeProps })), content.shape === 'circle' && (_jsx("circle", { cx: x + width / 2, cy: y + height / 2, r: Math.min(width, height) / 2, ...shapeProps })), content.shape === 'line' && (_jsx("line", { x1: x, y1: y, x2: x + width, y2: y + height, stroke: content.stroke || '#ffffff', strokeWidth: content.strokeWidth || 2 }))] }));
|
|
37
|
-
}
|
|
38
|
-
export default ShapeLayer;
|
|
39
|
-
//# sourceMappingURL=ShapeLayer.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ShapeLayer.js","sourceRoot":"","sources":["../../src/layers/ShapeLayer.tsx"],"names":[],"mappings":";AAQA,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAC;AAUpE,MAAM,UAAU,UAAU,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAmB;IACxE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,GAAG,KAAK,CAAC;IAE/C,oCAAoC;IACpC,MAAM,IAAI,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;IACtD,MAAM,IAAI,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC;IACvD,MAAM,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,YAAY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
/**
|
|
2
|
-
* TableLayer Component
|
|
3
|
-
*
|
|
4
|
-
* Renders a data table within an SVG block using a <foreignObject> to embed
|
|
5
|
-
* an HTML table. This gives us native table layout inside SVG viewports.
|
|
6
|
-
*
|
|
7
|
-
* The table is styled inline using the TableLayerStyle properties, which are
|
|
8
|
-
* typically derived from the active theme by the dataTable template.
|
|
9
|
-
*/
|
|
10
|
-
import type { TableLayer as TableLayerType } from '@bendyline/squisq/schemas';
|
|
11
|
-
interface TableLayerProps {
|
|
12
|
-
layer: TableLayerType;
|
|
13
|
-
/** Viewport dimensions for percentage calculations */
|
|
14
|
-
viewport: {
|
|
15
|
-
width: number;
|
|
16
|
-
height: number;
|
|
17
|
-
};
|
|
18
|
-
/** Current time relative to block start (for animation) */
|
|
19
|
-
blockTime: number;
|
|
20
|
-
}
|
|
21
|
-
export declare function TableLayer({ layer, viewport, blockTime }: TableLayerProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
-
export {};
|
|
23
|
-
//# sourceMappingURL=TableLayer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TableLayer.d.ts","sourceRoot":"","sources":["../../src/layers/TableLayer.tsx"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,KAAK,EAAE,UAAU,IAAI,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAI9E,UAAU,eAAe;IACvB,KAAK,EAAE,cAAc,CAAC;IACtB,sDAAsD;IACtD,QAAQ,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAC5C,2DAA2D;IAC3D,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wBAAgB,UAAU,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,EAAE,eAAe,2CA0GzE"}
|