@measured/puck-plugin-heading-analyzer 0.18.0-canary.d253d54 → 0.18.0-canary.e2139f5
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.mts +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +47 -9
- package/dist/index.mjs +49 -11
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
@@ -135,6 +135,7 @@ type UiState = {
|
|
135
135
|
rightSideBarVisible: boolean;
|
136
136
|
itemSelector: ItemSelector | null;
|
137
137
|
arrayState: Record<string, ArrayState | undefined>;
|
138
|
+
previewMode: "interactive" | "edit";
|
138
139
|
componentList: Record<string, {
|
139
140
|
components?: string[];
|
140
141
|
title?: string;
|
package/dist/index.d.ts
CHANGED
@@ -135,6 +135,7 @@ type UiState = {
|
|
135
135
|
rightSideBarVisible: boolean;
|
136
136
|
itemSelector: ItemSelector | null;
|
137
137
|
arrayState: Record<string, ArrayState | undefined>;
|
138
|
+
previewMode: "interactive" | "edit";
|
138
139
|
componentList: Record<string, {
|
139
140
|
components?: string[];
|
140
141
|
title?: string;
|
package/dist/index.js
CHANGED
@@ -308,13 +308,11 @@ var import_react8 = require("react");
|
|
308
308
|
|
309
309
|
// ../core/components/DropZone/context.tsx
|
310
310
|
init_react_import();
|
311
|
-
var
|
312
|
-
var import_jsx_runtime2 = require("react/jsx-runtime");
|
313
|
-
var dropZoneContext = (0, import_react4.createContext)(null);
|
311
|
+
var import_react7 = require("react");
|
314
312
|
|
315
313
|
// ../core/components/Puck/context.tsx
|
316
314
|
init_react_import();
|
317
|
-
var
|
315
|
+
var import_react6 = require("react");
|
318
316
|
|
319
317
|
// ../core/lib/get-item.ts
|
320
318
|
init_react_import();
|
@@ -336,7 +334,7 @@ var defaultViewports = [
|
|
336
334
|
|
337
335
|
// ../core/lib/use-resolved-permissions.ts
|
338
336
|
init_react_import();
|
339
|
-
var
|
337
|
+
var import_react4 = require("react");
|
340
338
|
|
341
339
|
// ../core/lib/flatten-data.ts
|
342
340
|
init_react_import();
|
@@ -346,7 +344,7 @@ init_react_import();
|
|
346
344
|
|
347
345
|
// ../core/lib/use-resolved-data.ts
|
348
346
|
init_react_import();
|
349
|
-
var
|
347
|
+
var import_react5 = require("react");
|
350
348
|
|
351
349
|
// ../core/lib/resolve-component-data.ts
|
352
350
|
init_react_import();
|
@@ -358,7 +356,7 @@ init_react_import();
|
|
358
356
|
init_react_import();
|
359
357
|
|
360
358
|
// ../core/components/Puck/context.tsx
|
361
|
-
var
|
359
|
+
var import_jsx_runtime2 = require("react/jsx-runtime");
|
362
360
|
var defaultAppState = {
|
363
361
|
data: { content: [], root: {} },
|
364
362
|
ui: {
|
@@ -368,6 +366,7 @@ var defaultAppState = {
|
|
368
366
|
itemSelector: null,
|
369
367
|
componentList: {},
|
370
368
|
isDragging: false,
|
369
|
+
previewMode: "edit",
|
371
370
|
viewports: {
|
372
371
|
current: {
|
373
372
|
width: defaultViewports[0].width,
|
@@ -405,9 +404,9 @@ var defaultContext = {
|
|
405
404
|
getPermissions: () => ({}),
|
406
405
|
refreshPermissions: () => null
|
407
406
|
};
|
408
|
-
var appContext = (0,
|
407
|
+
var appContext = (0, import_react6.createContext)(defaultContext);
|
409
408
|
function useAppContext() {
|
410
|
-
const mainContext = (0,
|
409
|
+
const mainContext = (0, import_react6.useContext)(appContext);
|
411
410
|
return __spreadProps(__spreadValues({}, mainContext), {
|
412
411
|
// Helpers
|
413
412
|
setUi: (ui, recordHistory) => {
|
@@ -420,6 +419,45 @@ function useAppContext() {
|
|
420
419
|
});
|
421
420
|
}
|
422
421
|
|
422
|
+
// ../../node_modules/zustand/esm/vanilla.mjs
|
423
|
+
init_react_import();
|
424
|
+
var createStoreImpl = (createState) => {
|
425
|
+
let state;
|
426
|
+
const listeners = /* @__PURE__ */ new Set();
|
427
|
+
const setState = (partial, replace) => {
|
428
|
+
const nextState = typeof partial === "function" ? partial(state) : partial;
|
429
|
+
if (!Object.is(nextState, state)) {
|
430
|
+
const previousState = state;
|
431
|
+
state = (replace != null ? replace : typeof nextState !== "object" || nextState === null) ? nextState : Object.assign({}, state, nextState);
|
432
|
+
listeners.forEach((listener) => listener(state, previousState));
|
433
|
+
}
|
434
|
+
};
|
435
|
+
const getState = () => state;
|
436
|
+
const getInitialState = () => initialState;
|
437
|
+
const subscribe = (listener) => {
|
438
|
+
listeners.add(listener);
|
439
|
+
return () => listeners.delete(listener);
|
440
|
+
};
|
441
|
+
const api = { setState, getState, getInitialState, subscribe };
|
442
|
+
const initialState = state = createState(setState, getState, api);
|
443
|
+
return api;
|
444
|
+
};
|
445
|
+
var createStore = (createState) => createState ? createStoreImpl(createState) : createStoreImpl;
|
446
|
+
|
447
|
+
// ../core/components/DropZone/context.tsx
|
448
|
+
var import_jsx_runtime3 = require("react/jsx-runtime");
|
449
|
+
var dropZoneContext = (0, import_react7.createContext)(null);
|
450
|
+
var ZoneStoreContext = (0, import_react7.createContext)(
|
451
|
+
createStore(() => ({
|
452
|
+
zoneDepthIndex: {},
|
453
|
+
nextZoneDepthIndex: {},
|
454
|
+
areaDepthIndex: {},
|
455
|
+
nextAreaDepthIndex: {},
|
456
|
+
draggedItem: null,
|
457
|
+
previewIndex: {}
|
458
|
+
}))
|
459
|
+
);
|
460
|
+
|
423
461
|
// ../core/lib/get-zone-id.ts
|
424
462
|
init_react_import();
|
425
463
|
var getZoneId = (zoneCompound) => {
|
package/dist/index.mjs
CHANGED
@@ -297,21 +297,19 @@ import { useContext as useContext2, useMemo as useMemo2 } from "react";
|
|
297
297
|
// ../core/components/DropZone/context.tsx
|
298
298
|
init_react_import();
|
299
299
|
import {
|
300
|
-
createContext,
|
301
|
-
useCallback,
|
300
|
+
createContext as createContext2,
|
301
|
+
useCallback as useCallback3,
|
302
302
|
useMemo,
|
303
|
-
useState
|
303
|
+
useState as useState4
|
304
304
|
} from "react";
|
305
|
-
import { Fragment, jsx as jsx2 } from "react/jsx-runtime";
|
306
|
-
var dropZoneContext = createContext(null);
|
307
305
|
|
308
306
|
// ../core/components/Puck/context.tsx
|
309
307
|
init_react_import();
|
310
308
|
import {
|
311
|
-
createContext
|
309
|
+
createContext,
|
312
310
|
useContext,
|
313
311
|
useEffect as useEffect3,
|
314
|
-
useState as
|
312
|
+
useState as useState3
|
315
313
|
} from "react";
|
316
314
|
|
317
315
|
// ../core/lib/get-item.ts
|
@@ -334,7 +332,7 @@ var defaultViewports = [
|
|
334
332
|
|
335
333
|
// ../core/lib/use-resolved-permissions.ts
|
336
334
|
init_react_import();
|
337
|
-
import { useCallback
|
335
|
+
import { useCallback, useEffect, useState } from "react";
|
338
336
|
|
339
337
|
// ../core/lib/flatten-data.ts
|
340
338
|
init_react_import();
|
@@ -344,7 +342,7 @@ init_react_import();
|
|
344
342
|
|
345
343
|
// ../core/lib/use-resolved-data.ts
|
346
344
|
init_react_import();
|
347
|
-
import { useCallback as
|
345
|
+
import { useCallback as useCallback2, useEffect as useEffect2, useState as useState2 } from "react";
|
348
346
|
|
349
347
|
// ../core/lib/resolve-component-data.ts
|
350
348
|
init_react_import();
|
@@ -356,7 +354,7 @@ init_react_import();
|
|
356
354
|
init_react_import();
|
357
355
|
|
358
356
|
// ../core/components/Puck/context.tsx
|
359
|
-
import { jsx as
|
357
|
+
import { jsx as jsx2 } from "react/jsx-runtime";
|
360
358
|
var defaultAppState = {
|
361
359
|
data: { content: [], root: {} },
|
362
360
|
ui: {
|
@@ -366,6 +364,7 @@ var defaultAppState = {
|
|
366
364
|
itemSelector: null,
|
367
365
|
componentList: {},
|
368
366
|
isDragging: false,
|
367
|
+
previewMode: "edit",
|
369
368
|
viewports: {
|
370
369
|
current: {
|
371
370
|
width: defaultViewports[0].width,
|
@@ -403,7 +402,7 @@ var defaultContext = {
|
|
403
402
|
getPermissions: () => ({}),
|
404
403
|
refreshPermissions: () => null
|
405
404
|
};
|
406
|
-
var appContext =
|
405
|
+
var appContext = createContext(defaultContext);
|
407
406
|
function useAppContext() {
|
408
407
|
const mainContext = useContext(appContext);
|
409
408
|
return __spreadProps(__spreadValues({}, mainContext), {
|
@@ -418,6 +417,45 @@ function useAppContext() {
|
|
418
417
|
});
|
419
418
|
}
|
420
419
|
|
420
|
+
// ../../node_modules/zustand/esm/vanilla.mjs
|
421
|
+
init_react_import();
|
422
|
+
var createStoreImpl = (createState) => {
|
423
|
+
let state;
|
424
|
+
const listeners = /* @__PURE__ */ new Set();
|
425
|
+
const setState = (partial, replace) => {
|
426
|
+
const nextState = typeof partial === "function" ? partial(state) : partial;
|
427
|
+
if (!Object.is(nextState, state)) {
|
428
|
+
const previousState = state;
|
429
|
+
state = (replace != null ? replace : typeof nextState !== "object" || nextState === null) ? nextState : Object.assign({}, state, nextState);
|
430
|
+
listeners.forEach((listener) => listener(state, previousState));
|
431
|
+
}
|
432
|
+
};
|
433
|
+
const getState = () => state;
|
434
|
+
const getInitialState = () => initialState;
|
435
|
+
const subscribe = (listener) => {
|
436
|
+
listeners.add(listener);
|
437
|
+
return () => listeners.delete(listener);
|
438
|
+
};
|
439
|
+
const api = { setState, getState, getInitialState, subscribe };
|
440
|
+
const initialState = state = createState(setState, getState, api);
|
441
|
+
return api;
|
442
|
+
};
|
443
|
+
var createStore = (createState) => createState ? createStoreImpl(createState) : createStoreImpl;
|
444
|
+
|
445
|
+
// ../core/components/DropZone/context.tsx
|
446
|
+
import { Fragment, jsx as jsx3 } from "react/jsx-runtime";
|
447
|
+
var dropZoneContext = createContext2(null);
|
448
|
+
var ZoneStoreContext = createContext2(
|
449
|
+
createStore(() => ({
|
450
|
+
zoneDepthIndex: {},
|
451
|
+
nextZoneDepthIndex: {},
|
452
|
+
areaDepthIndex: {},
|
453
|
+
nextAreaDepthIndex: {},
|
454
|
+
draggedItem: null,
|
455
|
+
previewIndex: {}
|
456
|
+
}))
|
457
|
+
);
|
458
|
+
|
421
459
|
// ../core/lib/get-zone-id.ts
|
422
460
|
init_react_import();
|
423
461
|
var getZoneId = (zoneCompound) => {
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@measured/puck-plugin-heading-analyzer",
|
3
|
-
"version": "0.18.0-canary.
|
3
|
+
"version": "0.18.0-canary.e2139f5",
|
4
4
|
"author": "Measured Corporation Ltd <hello@measured.co>",
|
5
5
|
"repository": "measuredco/puck",
|
6
6
|
"bugs": "https://github.com/measuredco/puck/issues",
|
@@ -25,7 +25,7 @@
|
|
25
25
|
"dist"
|
26
26
|
],
|
27
27
|
"devDependencies": {
|
28
|
-
"@measured/puck": "^0.18.0-canary.
|
28
|
+
"@measured/puck": "^0.18.0-canary.e2139f5",
|
29
29
|
"@types/react": "^19.0.1",
|
30
30
|
"@types/react-dom": "^19.0.2",
|
31
31
|
"eslint": "^7.32.0",
|