@prenta/admin 2.16.2 → 2.16.4
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/CHANGELOG.md +12 -0
- package/README.md +2 -2
- package/dist/__tests__/views/editor-top-bar-layout.render.test.d.ts +2 -0
- package/dist/__tests__/views/editor-top-bar-layout.render.test.d.ts.map +1 -0
- package/dist/__tests__/views/editor-top-bar-layout.render.test.js +157 -0
- package/dist/__tests__/views/editor-top-bar-layout.render.test.js.map +1 -0
- package/dist/components/BreakpointPicker.d.ts.map +1 -1
- package/dist/components/BreakpointPicker.js +2 -2
- package/dist/components/BreakpointPicker.js.map +1 -1
- package/dist/prenta-admin.css +1 -1
- package/dist/views/page-editor/EditorTopBar.d.ts.map +1 -1
- package/dist/views/page-editor/EditorTopBar.js +28 -17
- package/dist/views/page-editor/EditorTopBar.js.map +1 -1
- package/dist/views/page-editor/SectionEditForm.js +1 -1
- package/dist/views/page-editor/SectionEditForm.js.map +1 -1
- package/package.json +12 -12
- package/src/__tests__/views/editor-top-bar-layout.render.test.tsx +198 -0
- package/src/components/BreakpointPicker.tsx +7 -6
- package/src/styles/responsive.css +44 -18
- package/src/views/page-editor/EditorTopBar.tsx +109 -65
- package/src/views/page-editor/SectionEditForm.tsx +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @actuate-media/cms-admin
|
|
2
2
|
|
|
3
|
+
## 2.16.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 5230917: Point repository links at github.com/Prenta-dev/prenta, where the source now lives. The `repository` field on npm, the importer adapters' docs links, the section editor's help link and the docs link `create-prenta` prints all moved from `actuate-media/prenta`. No behaviour changes.
|
|
8
|
+
|
|
9
|
+
## 2.16.3
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 6cdf767: Fix the page and post editor toolbar wrapping and overlapping. With the sidebar open at laptop widths, "View site", "Save Draft", "Request changes" and the canvas-width picker wrapped their labels onto two lines, the status label printed over the breadcrumb, and on a phone the review actions fell off-screen. The toolbar's own actions (view, share, save, schedule, review, settings, SEO, history, undo and redo) now use the shared button, so they share one height, take its accent styling and never wrap their labels. Share, Schedule and Request changes drop to icons, and the canvas-width picker to its short name, when the toolbar itself is narrower than 1360px, whatever the window width. When it is still too tight the actions take a second line and the title keeps a minimum width. A long reviewer note is truncated with the full text in its tooltip.
|
|
14
|
+
|
|
3
15
|
## 2.16.2
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @prenta/admin
|
|
2
2
|
|
|
3
|
-
The React admin UI for [Prenta CMS](https://github.com/
|
|
3
|
+
The React admin UI for [Prenta CMS](https://github.com/Prenta-dev/prenta):
|
|
4
4
|
page/post section editors, media library, forms inbox, SEO tools, settings, and
|
|
5
5
|
the setup wizard — mounted in your app via a single component.
|
|
6
6
|
|
|
@@ -28,7 +28,7 @@ site's CSS.
|
|
|
28
28
|
## Release notes
|
|
29
29
|
|
|
30
30
|
See [CHANGELOG.md](./CHANGELOG.md) (shipped with the package) or the
|
|
31
|
-
[GitHub releases](https://github.com/
|
|
31
|
+
[GitHub releases](https://github.com/Prenta-dev/prenta/releases).
|
|
32
32
|
|
|
33
33
|
## License
|
|
34
34
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-top-bar-layout.render.test.d.ts","sourceRoot":"","sources":["../../../src/__tests__/views/editor-top-bar-layout.render.test.tsx"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
// @vitest-environment happy-dom
|
|
3
|
+
import { readFileSync } from 'node:fs';
|
|
4
|
+
import path from 'node:path';
|
|
5
|
+
import { afterEach, describe, expect, it, vi } from 'vitest';
|
|
6
|
+
import { cleanup, render, screen } from '@testing-library/react';
|
|
7
|
+
import { EditorTopBar } from '../../views/page-editor/EditorTopBar.js';
|
|
8
|
+
afterEach(cleanup);
|
|
9
|
+
/**
|
|
10
|
+
* A post in review, seen by an editor, with a public site: the fullest bar
|
|
11
|
+
* the editor shows. This is the state that wrapped its buttons onto two
|
|
12
|
+
* lines at 1280px with the sidebar open.
|
|
13
|
+
*/
|
|
14
|
+
const reviewProps = {
|
|
15
|
+
title: 'Mary Frances: +60% Ecommerce Revenue with an Integrated Digital Strategy',
|
|
16
|
+
status: 'DRAFT',
|
|
17
|
+
workflowStage: 'IN_REVIEW',
|
|
18
|
+
role: 'EDITOR',
|
|
19
|
+
dirty: true,
|
|
20
|
+
saveState: 'idle',
|
|
21
|
+
publishing: false,
|
|
22
|
+
canEdit: true,
|
|
23
|
+
publishReady: true,
|
|
24
|
+
hasPublicSiteUrl: true,
|
|
25
|
+
viewport: 'wide',
|
|
26
|
+
backLabel: 'Posts',
|
|
27
|
+
onViewport: vi.fn(),
|
|
28
|
+
onBack: vi.fn(),
|
|
29
|
+
onOpenSettings: vi.fn(),
|
|
30
|
+
onOpenSeo: vi.fn(),
|
|
31
|
+
onHistory: vi.fn(),
|
|
32
|
+
onViewOnSite: vi.fn(),
|
|
33
|
+
onShare: vi.fn(),
|
|
34
|
+
onSchedule: vi.fn(),
|
|
35
|
+
onSaveDraft: vi.fn(),
|
|
36
|
+
onSubmitForReview: vi.fn(),
|
|
37
|
+
onApprove: vi.fn(),
|
|
38
|
+
onRequestChanges: vi.fn(),
|
|
39
|
+
};
|
|
40
|
+
const TEXT_ACTIONS = [
|
|
41
|
+
'View site',
|
|
42
|
+
'Share',
|
|
43
|
+
'Save Draft',
|
|
44
|
+
'Schedule publish',
|
|
45
|
+
'Approve',
|
|
46
|
+
'Request changes',
|
|
47
|
+
];
|
|
48
|
+
// happy-dom gives this module an http URL, so resolve from the package root.
|
|
49
|
+
const css = readFileSync(path.resolve(process.cwd(), 'src/styles/responsive.css'), 'utf-8');
|
|
50
|
+
describe('EditorTopBar layout', () => {
|
|
51
|
+
it('gives every text action the same height and never lets its label wrap', () => {
|
|
52
|
+
render(_jsx(EditorTopBar, { ...reviewProps }));
|
|
53
|
+
for (const name of TEXT_ACTIONS) {
|
|
54
|
+
const button = screen.getByRole('button', { name });
|
|
55
|
+
const classes = button.className.split(/\s+/);
|
|
56
|
+
expect(classes, `${name} can wrap`).toContain('whitespace-nowrap');
|
|
57
|
+
expect(classes, `${name} can be squeezed`).toContain('shrink-0');
|
|
58
|
+
expect(classes, `${name} is not 34px tall`).toContain('h-[34px]');
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
it('makes the icon buttons the same height as the text actions', () => {
|
|
62
|
+
render(_jsx(EditorTopBar, { ...reviewProps, onUndo: vi.fn(), onRedo: vi.fn() }));
|
|
63
|
+
for (const name of ['Post settings', 'Version history', 'Undo', 'Redo']) {
|
|
64
|
+
const classes = screen.getByRole('button', { name }).className.split(/\s+/);
|
|
65
|
+
expect(classes, `${name} is not 34px`).toEqual(expect.arrayContaining(['h-[34px]', 'w-[34px]']));
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
it('lets the bar grow and wrap instead of crushing the title into a fixed row', () => {
|
|
69
|
+
const { container } = render(_jsx(EditorTopBar, { ...reviewProps }));
|
|
70
|
+
const classes = container.querySelector('header').className.split(/\s+/);
|
|
71
|
+
expect(classes).toContain('flex-wrap');
|
|
72
|
+
expect(classes).toContain('min-h-14');
|
|
73
|
+
expect(classes).not.toContain('h-14');
|
|
74
|
+
});
|
|
75
|
+
it('keeps the breadcrumb inside its own box so the status cannot print over it', () => {
|
|
76
|
+
render(_jsx(EditorTopBar, { ...reviewProps }));
|
|
77
|
+
const nav = screen.getByRole('navigation', { name: 'Breadcrumb' });
|
|
78
|
+
expect(nav.className.split(/\s+/)).toContain('overflow-hidden');
|
|
79
|
+
});
|
|
80
|
+
it('reserves room for a readable title before the actions may stay on its line', () => {
|
|
81
|
+
render(_jsx(EditorTopBar, { ...reviewProps }));
|
|
82
|
+
const nav = screen.getByRole('navigation', { name: 'Breadcrumb' });
|
|
83
|
+
// The title's floor, and a left group that cannot shrink below its content.
|
|
84
|
+
expect(nav.className.split(/\s+/)).toContain('min-w-[5rem]');
|
|
85
|
+
expect(nav.parentElement.className.split(/\s+/)).toContain('min-w-min');
|
|
86
|
+
// A stylesheet reset of that minimum is what let the title collapse.
|
|
87
|
+
expect(css).not.toMatch(/\.prenta-editor-header > \*\s*\{\s*min-width:\s*0/);
|
|
88
|
+
});
|
|
89
|
+
it('never breaks the save status onto two lines, and lets it give way before the bar wraps', () => {
|
|
90
|
+
render(_jsx(EditorTopBar, { ...reviewProps }));
|
|
91
|
+
expect(screen.getByText('Unsaved changes').className.split(/\s+/)).toContain('truncate');
|
|
92
|
+
});
|
|
93
|
+
it('gives each collapsible action a touch target, since it becomes an icon button', () => {
|
|
94
|
+
render(_jsx(EditorTopBar, { ...reviewProps }));
|
|
95
|
+
for (const name of ['Share', 'Schedule publish', 'Request changes']) {
|
|
96
|
+
expect(screen.getByRole('button', { name }).className).toContain('prenta-touch-target');
|
|
97
|
+
}
|
|
98
|
+
});
|
|
99
|
+
it('forces the narrow SEO padding past the shared button padding', () => {
|
|
100
|
+
render(_jsx(EditorTopBar, { ...reviewProps, seoScore: 80 }));
|
|
101
|
+
const seo = screen.getByRole('button', { name: /^SEO/ });
|
|
102
|
+
expect(seo.className.split(/\s+/)).toContain('px-2!');
|
|
103
|
+
});
|
|
104
|
+
it('truncates a long reviewer note and keeps the full text in a title', () => {
|
|
105
|
+
const note = 'Please tighten the opening, check every figure against the client report, and add a quote.';
|
|
106
|
+
render(_jsx(EditorTopBar, { ...reviewProps, workflowStage: "DRAFT", reviewNote: note }));
|
|
107
|
+
const shown = screen.getByText(new RegExp(note.slice(0, 20)));
|
|
108
|
+
expect(shown.className.split(/\s+/)).toContain('truncate');
|
|
109
|
+
expect(shown.getAttribute('title')).toContain(note);
|
|
110
|
+
});
|
|
111
|
+
it('marks the secondary actions as collapsible, each with a name that survives a hidden label', () => {
|
|
112
|
+
render(_jsx(EditorTopBar, { ...reviewProps }));
|
|
113
|
+
for (const name of ['Share', 'Schedule publish', 'Request changes']) {
|
|
114
|
+
const button = screen.getByRole('button', { name });
|
|
115
|
+
expect(button.className, `${name} cannot collapse`).toContain('prenta-editor-collapsible');
|
|
116
|
+
expect(button.getAttribute('aria-label'), `${name} loses its name as an icon`).toBeTruthy();
|
|
117
|
+
expect(button.querySelector('.prenta-editor-label'), `${name} has no label to hide`).not.toBeNull();
|
|
118
|
+
expect(button.querySelector('svg'), `${name} has no icon to fall back to`).not.toBeNull();
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
it('never collapses the actions an author must be able to read', () => {
|
|
122
|
+
render(_jsx(EditorTopBar, { ...reviewProps }));
|
|
123
|
+
for (const name of ['View site', 'Save Draft', 'Approve']) {
|
|
124
|
+
const button = screen.getByRole('button', { name });
|
|
125
|
+
expect(button.className).not.toContain('prenta-editor-collapsible');
|
|
126
|
+
expect(button.querySelector('.prenta-editor-label')).toBeNull();
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
it('still shows the reason on a disabled action', () => {
|
|
130
|
+
render(_jsx(EditorTopBar, { ...reviewProps, publishReady: false, publishDisabledReason: "Add a title before publishing" }));
|
|
131
|
+
const approve = screen.getByRole('button', { name: 'Approve' });
|
|
132
|
+
expect(approve.getAttribute('title')).toBe('Add a title before publishing');
|
|
133
|
+
// The shared Button ignores the pointer while disabled, which would hide
|
|
134
|
+
// the title; these opt back in.
|
|
135
|
+
expect(approve.className).toContain('disabled:pointer-events-auto!');
|
|
136
|
+
});
|
|
137
|
+
});
|
|
138
|
+
describe('editor bar responsive rules', () => {
|
|
139
|
+
it("collapses by the bar's own width, not the viewport's", () => {
|
|
140
|
+
expect(css).toMatch(/\.prenta-editor-header\s*\{\s*container:\s*editor-header\s*\/\s*inline-size/);
|
|
141
|
+
expect(css).toMatch(/@container editor-header \(max-width: 1360px\)/);
|
|
142
|
+
// The old rule keyed off the window, so a 1280px window with the sidebar
|
|
143
|
+
// open (a 1050px bar) never triggered it.
|
|
144
|
+
expect(css).not.toMatch(/@media \(max-width: 1180px\)\s*\{\s*\.prenta-admin \.prenta-editor-header/);
|
|
145
|
+
});
|
|
146
|
+
it('draws the back button focus ring inside the clipped breadcrumb', () => {
|
|
147
|
+
// overflow-hidden on the breadcrumb would cut off an outline drawn outside it.
|
|
148
|
+
expect(css).toMatch(/\.prenta-editor-header nav button:focus-visible\s*\{\s*outline-offset:\s*-2px/);
|
|
149
|
+
});
|
|
150
|
+
it('hides labels, shows the short canvas name and squares the buttons when collapsed', () => {
|
|
151
|
+
const block = css.slice(css.indexOf('@container editor-header'));
|
|
152
|
+
expect(block).toMatch(/\.prenta-editor-label\s*\{\s*display:\s*none/);
|
|
153
|
+
expect(block).toMatch(/\.prenta-editor-abbr\s*\{\s*display:\s*inline/);
|
|
154
|
+
expect(block).toMatch(/\.prenta-editor-collapsible\s*\{[^}]*width:\s*34px/);
|
|
155
|
+
});
|
|
156
|
+
});
|
|
157
|
+
//# sourceMappingURL=editor-top-bar-layout.render.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"editor-top-bar-layout.render.test.js","sourceRoot":"","sources":["../../../src/__tests__/views/editor-top-bar-layout.render.test.tsx"],"names":[],"mappings":";AAAA,gCAAgC;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AACtC,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AAC5D,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEhE,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAA;AAEtE,SAAS,CAAC,OAAO,CAAC,CAAA;AAElB;;;;GAIG;AACH,MAA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;QAC1C,MAAM,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,OAAO,CACrB,2EAA2E,CAC5E,CAAA;IACH,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,gEAAgE,EAAE,GAAG,EAAE;QACxE,+EAA+E;QAC/E,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CACjB,+EAA+E,CAChF,CAAA;IACH,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,kFAAkF,EAAE,GAAG,EAAE;QAC1F,MAAM,KAAK,GAAG,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,0BAA0B,CAAC,CAAC,CAAA;QAChE,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,8CAA8C,CAAC,CAAA;QACrE,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,+CAA+C,CAAC,CAAA;QACtE,MAAM,CAAC,KAAK,CAAC,CAAC,OAAO,CAAC,oDAAoD,CAAC,CAAA;IAC7E,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BreakpointPicker.d.ts","sourceRoot":"","sources":["../../src/components/BreakpointPicker.tsx"],"names":[],"mappings":"AAMA,OAAO,EAIL,KAAK,YAAY,EAClB,MAAM,uBAAuB,CAAA;AAG9B,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,YAAY,CAAA;IACnB,QAAQ,EAAE,CAAC,EAAE,EAAE,YAAY,KAAK,IAAI,CAAA;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,qBAAqB,
|
|
1
|
+
{"version":3,"file":"BreakpointPicker.d.ts","sourceRoot":"","sources":["../../src/components/BreakpointPicker.tsx"],"names":[],"mappings":"AAMA,OAAO,EAIL,KAAK,YAAY,EAClB,MAAM,uBAAuB,CAAA;AAG9B,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,YAAY,CAAA;IACnB,QAAQ,EAAE,CAAC,EAAE,EAAE,YAAY,KAAK,IAAI,CAAA;IACpC,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,gBAAgB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAE,EAAE,qBAAqB,2CAsFpF"}
|
|
@@ -22,9 +22,9 @@ export function BreakpointPicker({ value, onChange, disabled }) {
|
|
|
22
22
|
const active = getBreakpoint(value);
|
|
23
23
|
const ActiveIcon = breakpointIcon(active.icon);
|
|
24
24
|
const canvasWidthLabel = `Canvas width: ${active.name}, ${active.width} pixels. First-party layout only — use View site for the live design.`;
|
|
25
|
-
return (_jsxs(DropdownMenu.Root, { open: open, onOpenChange: setOpen, children: [_jsx(DropdownMenu.Trigger, { asChild: true, children: _jsxs("button", { type: "button", disabled: disabled, "aria-label": canvasWidthLabel, title: canvasWidthLabel, className: `border-border flex h-[34px] items-center gap-1.5 rounded-lg border px-2.5 text-[12.5px] font-medium transition-colors disabled:opacity-50 ${open
|
|
25
|
+
return (_jsxs(DropdownMenu.Root, { open: open, onOpenChange: setOpen, children: [_jsx(DropdownMenu.Trigger, { asChild: true, children: _jsxs("button", { type: "button", disabled: disabled, "aria-label": canvasWidthLabel, title: canvasWidthLabel, className: `border-border flex h-[34px] shrink-0 items-center gap-1.5 rounded-lg border px-2.5 text-[12.5px] font-medium transition-colors disabled:opacity-50 ${open
|
|
26
26
|
? 'border-brand bg-accent text-accent-foreground'
|
|
27
|
-
: 'bg-card text-foreground hover:bg-accent'}`, children: [_jsx(ActiveIcon, { className: `h-4 w-4 shrink-0 ${open ? '' : 'text-brand'}`, "aria-hidden": true }), _jsx("span", { className: "
|
|
27
|
+
: 'bg-card text-foreground hover:bg-accent'}`, children: [_jsx(ActiveIcon, { className: `h-4 w-4 shrink-0 ${open ? '' : 'text-brand'}`, "aria-hidden": true }), _jsx("span", { className: "prenta-editor-label whitespace-nowrap", children: active.name }), _jsx("span", { className: "prenta-editor-abbr", children: active.abbr }), _jsx("span", { className: "prenta-editor-label text-muted-foreground text-[11.5px] tabular-nums", children: active.width }), _jsx(ChevronDown, { className: `h-3.5 w-3.5 shrink-0 transition-transform ${open ? 'rotate-180' : ''}`, "aria-hidden": true })] }) }), _jsx(DropdownMenu.Portal, { container: adminPortalContainer(), children: _jsx(DropdownMenu.Content, { align: "end", sideOffset: 6, className: "border-border bg-popover data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:slide-in-from-top-1 z-[120] w-[272px] rounded-[10px] border p-[5px] shadow-[0_12px_34px_rgba(26,24,39,0.17)] duration-[130ms]", children: BREAKPOINT_GROUPS.map((group) => (_jsxs(DropdownMenu.Group, { children: [_jsx(DropdownMenu.Label, { className: "text-muted-foreground px-2.5 pt-2 pb-1 text-[10px] font-bold tracking-[0.6px]", children: group }), breakpointsInGroup(group).map((bp) => {
|
|
28
28
|
const Icon = breakpointIcon(bp.icon);
|
|
29
29
|
const selected = bp.id === value;
|
|
30
30
|
return (_jsxs(DropdownMenu.Item, { onSelect: () => onChange(bp.id), className: `focus:bg-accent flex cursor-pointer items-center gap-2 rounded-[7px] px-2.5 py-[7px] outline-none ${selected ? 'bg-accent' : ''}`, children: [_jsx(Icon, { className: `h-4 w-4 shrink-0 ${selected ? 'text-brand' : 'text-muted-foreground'}`, "aria-hidden": true }), _jsx("span", { className: `flex-1 text-[13px] ${selected ? 'text-brand font-semibold' : 'text-foreground'}`, children: bp.name }), _jsx("span", { className: "text-muted-foreground text-[11.5px] tabular-nums", children: bp.width }), _jsx(Check, { className: `text-brand h-3.5 w-3.5 shrink-0 ${selected ? '' : 'invisible'}`, "aria-label": selected ? 'Selected' : undefined })] }, bp.id));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BreakpointPicker.js","sourceRoot":"","sources":["../../src/components/BreakpointPicker.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,KAAK,YAAY,MAAM,+BAA+B,CAAA;AAC7D,OAAO,EAAE,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAA;AACjE,OAAO,EACL,iBAAiB,EACjB,kBAAkB,EAClB,aAAa,GAEd,MAAM,uBAAuB,CAAA;AAC9B,OAAO,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAQtD;;;;;;;;;;GAUG;AACH,MAAM,UAAU,gBAAgB,CAAC,EAAE,KAAK,EAAE,QAAQ,EAAE,QAAQ,EAAyB;IACnF,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAA;IACvC,MAAM,MAAM,GAAG,aAAa,CAAC,KAAK,CAAC,CAAA;IACnC,MAAM,UAAU,GAAG,cAAc,CAAC,MAAM,CAAC,IAAI,CAAC,CAAA;IAC9C,MAAM,gBAAgB,GAAG,iBAAiB,MAAM,CAAC,IAAI,KAAK,MAAM,CAAC,KAAK,uEAAuE,CAAA;IAE7I,OAAO,CACL,MAAC,YAAY,CAAC,IAAI,IAAC,IAAI,EAAE,IAAI,EAAE,YAAY,EAAE,OAAO,aAClD,KAAC,YAAY,CAAC,OAAO,IAAC,OAAO,kBAC3B,kBACE,IAAI,EAAC,QAAQ,EACb,QAAQ,EAAE,QAAQ,gBACN,gBAAgB,EAC5B,KAAK,EAAE,gBAAgB,EACvB,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"BreakpointPicker.js","sourceRoot":"","sources":["../../src/components/BreakpointPicker.tsx"],"names":[],"mappings":"AAAA,YAAY,CAAA;;AAEZ,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAChC,OAAO,KAAK,YAAY,MAAM,+BAA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