@measured/puck-plugin-heading-analyzer 0.14.0-canary.4932a6e → 0.14.0-canary.cbdf66d

Sign up to get free protection for your applications and to get access to all the features.
package/README.md CHANGED
@@ -13,6 +13,7 @@ npm i @measured/puck-plugin-heading-analyzer
13
13
  ```jsx
14
14
  import { Puck } from "@measured/puck";
15
15
  import headingAnalyzer from "@measured/puck-plugin-heading-analyzer";
16
+ import "@measured/puck-plugin-heading-analyzer/dist/index.css";
16
17
 
17
18
  ...
18
19
 
package/dist/index.d.ts CHANGED
@@ -5,6 +5,11 @@ type ItemSelector = {
5
5
  zone?: string;
6
6
  };
7
7
 
8
+ type FieldOption = {
9
+ label: string;
10
+ value: string | number | boolean;
11
+ };
12
+ type FieldOptions = Array<FieldOption> | ReadonlyArray<FieldOption>;
8
13
  type BaseField = {
9
14
  label?: string;
10
15
  };
@@ -21,17 +26,11 @@ type TextareaField = BaseField & {
21
26
  };
22
27
  type SelectField = BaseField & {
23
28
  type: "select";
24
- options: {
25
- label: string;
26
- value: string | number | boolean;
27
- }[];
29
+ options: FieldOptions;
28
30
  };
29
31
  type RadioField = BaseField & {
30
32
  type: "radio";
31
- options: {
32
- label: string;
33
- value: string | number | boolean;
34
- }[];
33
+ options: FieldOptions;
35
34
  };
36
35
  type ArrayField<Props extends {
37
36
  [key: string]: any;
package/dist/index.js CHANGED
@@ -21249,11 +21249,11 @@ var require_react_dom_development = __commonJS({
21249
21249
  }
21250
21250
  function registerMutableSourceForHydration(root2, mutableSource) {
21251
21251
  var getVersion2 = mutableSource._getVersion;
21252
- var version = getVersion2(mutableSource._source);
21252
+ var version2 = getVersion2(mutableSource._source);
21253
21253
  if (root2.mutableSourceEagerHydrationData == null) {
21254
- root2.mutableSourceEagerHydrationData = [mutableSource, version];
21254
+ root2.mutableSourceEagerHydrationData = [mutableSource, version2];
21255
21255
  } else {
21256
- root2.mutableSourceEagerHydrationData.push(mutableSource, version);
21256
+ root2.mutableSourceEagerHydrationData.push(mutableSource, version2);
21257
21257
  }
21258
21258
  }
21259
21259
  var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher, ReactCurrentBatchConfig$2 = ReactSharedInternals.ReactCurrentBatchConfig;
@@ -41046,6 +41046,374 @@ var init_index_module = __esm({
41046
41046
  }
41047
41047
  });
41048
41048
 
41049
+ // ../../node_modules/uuid/dist/esm-node/rng.js
41050
+ function rng() {
41051
+ if (poolPtr > rnds8Pool.length - 16) {
41052
+ import_crypto.default.randomFillSync(rnds8Pool);
41053
+ poolPtr = 0;
41054
+ }
41055
+ return rnds8Pool.slice(poolPtr, poolPtr += 16);
41056
+ }
41057
+ var import_crypto, rnds8Pool, poolPtr;
41058
+ var init_rng = __esm({
41059
+ "../../node_modules/uuid/dist/esm-node/rng.js"() {
41060
+ init_react_import();
41061
+ import_crypto = __toESM(require("crypto"));
41062
+ rnds8Pool = new Uint8Array(256);
41063
+ poolPtr = rnds8Pool.length;
41064
+ }
41065
+ });
41066
+
41067
+ // ../../node_modules/uuid/dist/esm-node/regex.js
41068
+ var regex_default;
41069
+ var init_regex = __esm({
41070
+ "../../node_modules/uuid/dist/esm-node/regex.js"() {
41071
+ init_react_import();
41072
+ regex_default = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
41073
+ }
41074
+ });
41075
+
41076
+ // ../../node_modules/uuid/dist/esm-node/validate.js
41077
+ function validate(uuid) {
41078
+ return typeof uuid === "string" && regex_default.test(uuid);
41079
+ }
41080
+ var validate_default;
41081
+ var init_validate = __esm({
41082
+ "../../node_modules/uuid/dist/esm-node/validate.js"() {
41083
+ init_react_import();
41084
+ init_regex();
41085
+ validate_default = validate;
41086
+ }
41087
+ });
41088
+
41089
+ // ../../node_modules/uuid/dist/esm-node/stringify.js
41090
+ function unsafeStringify(arr, offset3 = 0) {
41091
+ return byteToHex[arr[offset3 + 0]] + byteToHex[arr[offset3 + 1]] + byteToHex[arr[offset3 + 2]] + byteToHex[arr[offset3 + 3]] + "-" + byteToHex[arr[offset3 + 4]] + byteToHex[arr[offset3 + 5]] + "-" + byteToHex[arr[offset3 + 6]] + byteToHex[arr[offset3 + 7]] + "-" + byteToHex[arr[offset3 + 8]] + byteToHex[arr[offset3 + 9]] + "-" + byteToHex[arr[offset3 + 10]] + byteToHex[arr[offset3 + 11]] + byteToHex[arr[offset3 + 12]] + byteToHex[arr[offset3 + 13]] + byteToHex[arr[offset3 + 14]] + byteToHex[arr[offset3 + 15]];
41092
+ }
41093
+ function stringify(arr, offset3 = 0) {
41094
+ const uuid = unsafeStringify(arr, offset3);
41095
+ if (!validate_default(uuid)) {
41096
+ throw TypeError("Stringified UUID is invalid");
41097
+ }
41098
+ return uuid;
41099
+ }
41100
+ var byteToHex, stringify_default;
41101
+ var init_stringify = __esm({
41102
+ "../../node_modules/uuid/dist/esm-node/stringify.js"() {
41103
+ init_react_import();
41104
+ init_validate();
41105
+ byteToHex = [];
41106
+ for (let i2 = 0; i2 < 256; ++i2) {
41107
+ byteToHex.push((i2 + 256).toString(16).slice(1));
41108
+ }
41109
+ stringify_default = stringify;
41110
+ }
41111
+ });
41112
+
41113
+ // ../../node_modules/uuid/dist/esm-node/v1.js
41114
+ function v1(options, buf, offset3) {
41115
+ let i2 = buf && offset3 || 0;
41116
+ const b = buf || new Array(16);
41117
+ options = options || {};
41118
+ let node = options.node || _nodeId;
41119
+ let clockseq = options.clockseq !== void 0 ? options.clockseq : _clockseq;
41120
+ if (node == null || clockseq == null) {
41121
+ const seedBytes = options.random || (options.rng || rng)();
41122
+ if (node == null) {
41123
+ node = _nodeId = [seedBytes[0] | 1, seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
41124
+ }
41125
+ if (clockseq == null) {
41126
+ clockseq = _clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 16383;
41127
+ }
41128
+ }
41129
+ let msecs = options.msecs !== void 0 ? options.msecs : Date.now();
41130
+ let nsecs = options.nsecs !== void 0 ? options.nsecs : _lastNSecs + 1;
41131
+ const dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 1e4;
41132
+ if (dt < 0 && options.clockseq === void 0) {
41133
+ clockseq = clockseq + 1 & 16383;
41134
+ }
41135
+ if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === void 0) {
41136
+ nsecs = 0;
41137
+ }
41138
+ if (nsecs >= 1e4) {
41139
+ throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
41140
+ }
41141
+ _lastMSecs = msecs;
41142
+ _lastNSecs = nsecs;
41143
+ _clockseq = clockseq;
41144
+ msecs += 122192928e5;
41145
+ const tl = ((msecs & 268435455) * 1e4 + nsecs) % 4294967296;
41146
+ b[i2++] = tl >>> 24 & 255;
41147
+ b[i2++] = tl >>> 16 & 255;
41148
+ b[i2++] = tl >>> 8 & 255;
41149
+ b[i2++] = tl & 255;
41150
+ const tmh = msecs / 4294967296 * 1e4 & 268435455;
41151
+ b[i2++] = tmh >>> 8 & 255;
41152
+ b[i2++] = tmh & 255;
41153
+ b[i2++] = tmh >>> 24 & 15 | 16;
41154
+ b[i2++] = tmh >>> 16 & 255;
41155
+ b[i2++] = clockseq >>> 8 | 128;
41156
+ b[i2++] = clockseq & 255;
41157
+ for (let n2 = 0; n2 < 6; ++n2) {
41158
+ b[i2 + n2] = node[n2];
41159
+ }
41160
+ return buf || unsafeStringify(b);
41161
+ }
41162
+ var _nodeId, _clockseq, _lastMSecs, _lastNSecs, v1_default;
41163
+ var init_v1 = __esm({
41164
+ "../../node_modules/uuid/dist/esm-node/v1.js"() {
41165
+ init_react_import();
41166
+ init_rng();
41167
+ init_stringify();
41168
+ _lastMSecs = 0;
41169
+ _lastNSecs = 0;
41170
+ v1_default = v1;
41171
+ }
41172
+ });
41173
+
41174
+ // ../../node_modules/uuid/dist/esm-node/parse.js
41175
+ function parse3(uuid) {
41176
+ if (!validate_default(uuid)) {
41177
+ throw TypeError("Invalid UUID");
41178
+ }
41179
+ let v;
41180
+ const arr = new Uint8Array(16);
41181
+ arr[0] = (v = parseInt(uuid.slice(0, 8), 16)) >>> 24;
41182
+ arr[1] = v >>> 16 & 255;
41183
+ arr[2] = v >>> 8 & 255;
41184
+ arr[3] = v & 255;
41185
+ arr[4] = (v = parseInt(uuid.slice(9, 13), 16)) >>> 8;
41186
+ arr[5] = v & 255;
41187
+ arr[6] = (v = parseInt(uuid.slice(14, 18), 16)) >>> 8;
41188
+ arr[7] = v & 255;
41189
+ arr[8] = (v = parseInt(uuid.slice(19, 23), 16)) >>> 8;
41190
+ arr[9] = v & 255;
41191
+ arr[10] = (v = parseInt(uuid.slice(24, 36), 16)) / 1099511627776 & 255;
41192
+ arr[11] = v / 4294967296 & 255;
41193
+ arr[12] = v >>> 24 & 255;
41194
+ arr[13] = v >>> 16 & 255;
41195
+ arr[14] = v >>> 8 & 255;
41196
+ arr[15] = v & 255;
41197
+ return arr;
41198
+ }
41199
+ var parse_default;
41200
+ var init_parse = __esm({
41201
+ "../../node_modules/uuid/dist/esm-node/parse.js"() {
41202
+ init_react_import();
41203
+ init_validate();
41204
+ parse_default = parse3;
41205
+ }
41206
+ });
41207
+
41208
+ // ../../node_modules/uuid/dist/esm-node/v35.js
41209
+ function stringToBytes(str) {
41210
+ str = unescape(encodeURIComponent(str));
41211
+ const bytes = [];
41212
+ for (let i2 = 0; i2 < str.length; ++i2) {
41213
+ bytes.push(str.charCodeAt(i2));
41214
+ }
41215
+ return bytes;
41216
+ }
41217
+ function v35(name, version2, hashfunc) {
41218
+ function generateUUID(value, namespace, buf, offset3) {
41219
+ var _namespace;
41220
+ if (typeof value === "string") {
41221
+ value = stringToBytes(value);
41222
+ }
41223
+ if (typeof namespace === "string") {
41224
+ namespace = parse_default(namespace);
41225
+ }
41226
+ if (((_namespace = namespace) === null || _namespace === void 0 ? void 0 : _namespace.length) !== 16) {
41227
+ throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");
41228
+ }
41229
+ let bytes = new Uint8Array(16 + value.length);
41230
+ bytes.set(namespace);
41231
+ bytes.set(value, namespace.length);
41232
+ bytes = hashfunc(bytes);
41233
+ bytes[6] = bytes[6] & 15 | version2;
41234
+ bytes[8] = bytes[8] & 63 | 128;
41235
+ if (buf) {
41236
+ offset3 = offset3 || 0;
41237
+ for (let i2 = 0; i2 < 16; ++i2) {
41238
+ buf[offset3 + i2] = bytes[i2];
41239
+ }
41240
+ return buf;
41241
+ }
41242
+ return unsafeStringify(bytes);
41243
+ }
41244
+ try {
41245
+ generateUUID.name = name;
41246
+ } catch (err) {
41247
+ }
41248
+ generateUUID.DNS = DNS;
41249
+ generateUUID.URL = URL;
41250
+ return generateUUID;
41251
+ }
41252
+ var DNS, URL;
41253
+ var init_v35 = __esm({
41254
+ "../../node_modules/uuid/dist/esm-node/v35.js"() {
41255
+ init_react_import();
41256
+ init_stringify();
41257
+ init_parse();
41258
+ DNS = "6ba7b810-9dad-11d1-80b4-00c04fd430c8";
41259
+ URL = "6ba7b811-9dad-11d1-80b4-00c04fd430c8";
41260
+ }
41261
+ });
41262
+
41263
+ // ../../node_modules/uuid/dist/esm-node/md5.js
41264
+ function md5(bytes) {
41265
+ if (Array.isArray(bytes)) {
41266
+ bytes = Buffer.from(bytes);
41267
+ } else if (typeof bytes === "string") {
41268
+ bytes = Buffer.from(bytes, "utf8");
41269
+ }
41270
+ return import_crypto2.default.createHash("md5").update(bytes).digest();
41271
+ }
41272
+ var import_crypto2, md5_default;
41273
+ var init_md5 = __esm({
41274
+ "../../node_modules/uuid/dist/esm-node/md5.js"() {
41275
+ init_react_import();
41276
+ import_crypto2 = __toESM(require("crypto"));
41277
+ md5_default = md5;
41278
+ }
41279
+ });
41280
+
41281
+ // ../../node_modules/uuid/dist/esm-node/v3.js
41282
+ var v3, v3_default;
41283
+ var init_v3 = __esm({
41284
+ "../../node_modules/uuid/dist/esm-node/v3.js"() {
41285
+ init_react_import();
41286
+ init_v35();
41287
+ init_md5();
41288
+ v3 = v35("v3", 48, md5_default);
41289
+ v3_default = v3;
41290
+ }
41291
+ });
41292
+
41293
+ // ../../node_modules/uuid/dist/esm-node/native.js
41294
+ var import_crypto3, native_default;
41295
+ var init_native = __esm({
41296
+ "../../node_modules/uuid/dist/esm-node/native.js"() {
41297
+ init_react_import();
41298
+ import_crypto3 = __toESM(require("crypto"));
41299
+ native_default = {
41300
+ randomUUID: import_crypto3.default.randomUUID
41301
+ };
41302
+ }
41303
+ });
41304
+
41305
+ // ../../node_modules/uuid/dist/esm-node/v4.js
41306
+ function v4(options, buf, offset3) {
41307
+ if (native_default.randomUUID && !buf && !options) {
41308
+ return native_default.randomUUID();
41309
+ }
41310
+ options = options || {};
41311
+ const rnds = options.random || (options.rng || rng)();
41312
+ rnds[6] = rnds[6] & 15 | 64;
41313
+ rnds[8] = rnds[8] & 63 | 128;
41314
+ if (buf) {
41315
+ offset3 = offset3 || 0;
41316
+ for (let i2 = 0; i2 < 16; ++i2) {
41317
+ buf[offset3 + i2] = rnds[i2];
41318
+ }
41319
+ return buf;
41320
+ }
41321
+ return unsafeStringify(rnds);
41322
+ }
41323
+ var v4_default;
41324
+ var init_v4 = __esm({
41325
+ "../../node_modules/uuid/dist/esm-node/v4.js"() {
41326
+ init_react_import();
41327
+ init_native();
41328
+ init_rng();
41329
+ init_stringify();
41330
+ v4_default = v4;
41331
+ }
41332
+ });
41333
+
41334
+ // ../../node_modules/uuid/dist/esm-node/sha1.js
41335
+ function sha1(bytes) {
41336
+ if (Array.isArray(bytes)) {
41337
+ bytes = Buffer.from(bytes);
41338
+ } else if (typeof bytes === "string") {
41339
+ bytes = Buffer.from(bytes, "utf8");
41340
+ }
41341
+ return import_crypto4.default.createHash("sha1").update(bytes).digest();
41342
+ }
41343
+ var import_crypto4, sha1_default;
41344
+ var init_sha1 = __esm({
41345
+ "../../node_modules/uuid/dist/esm-node/sha1.js"() {
41346
+ init_react_import();
41347
+ import_crypto4 = __toESM(require("crypto"));
41348
+ sha1_default = sha1;
41349
+ }
41350
+ });
41351
+
41352
+ // ../../node_modules/uuid/dist/esm-node/v5.js
41353
+ var v5, v5_default;
41354
+ var init_v5 = __esm({
41355
+ "../../node_modules/uuid/dist/esm-node/v5.js"() {
41356
+ init_react_import();
41357
+ init_v35();
41358
+ init_sha1();
41359
+ v5 = v35("v5", 80, sha1_default);
41360
+ v5_default = v5;
41361
+ }
41362
+ });
41363
+
41364
+ // ../../node_modules/uuid/dist/esm-node/nil.js
41365
+ var nil_default;
41366
+ var init_nil = __esm({
41367
+ "../../node_modules/uuid/dist/esm-node/nil.js"() {
41368
+ init_react_import();
41369
+ nil_default = "00000000-0000-0000-0000-000000000000";
41370
+ }
41371
+ });
41372
+
41373
+ // ../../node_modules/uuid/dist/esm-node/version.js
41374
+ function version(uuid) {
41375
+ if (!validate_default(uuid)) {
41376
+ throw TypeError("Invalid UUID");
41377
+ }
41378
+ return parseInt(uuid.slice(14, 15), 16);
41379
+ }
41380
+ var version_default;
41381
+ var init_version = __esm({
41382
+ "../../node_modules/uuid/dist/esm-node/version.js"() {
41383
+ init_react_import();
41384
+ init_validate();
41385
+ version_default = version;
41386
+ }
41387
+ });
41388
+
41389
+ // ../../node_modules/uuid/dist/esm-node/index.js
41390
+ var esm_node_exports = {};
41391
+ __export(esm_node_exports, {
41392
+ NIL: () => nil_default,
41393
+ parse: () => parse_default,
41394
+ stringify: () => stringify_default,
41395
+ v1: () => v1_default,
41396
+ v3: () => v3_default,
41397
+ v4: () => v4_default,
41398
+ v5: () => v5_default,
41399
+ validate: () => validate_default,
41400
+ version: () => version_default
41401
+ });
41402
+ var init_esm_node = __esm({
41403
+ "../../node_modules/uuid/dist/esm-node/index.js"() {
41404
+ init_react_import();
41405
+ init_v1();
41406
+ init_v3();
41407
+ init_v4();
41408
+ init_v5();
41409
+ init_nil();
41410
+ init_version();
41411
+ init_validate();
41412
+ init_stringify();
41413
+ init_parse();
41414
+ }
41415
+ });
41416
+
41049
41417
  // ../../node_modules/react-hotkeys-hook/dist/react-hotkeys-hook.esm.js
41050
41418
  var react_hotkeys_hook_esm_exports = {};
41051
41419
  __export(react_hotkeys_hook_esm_exports, {
@@ -61105,11 +61473,11 @@ var require_dist = __commonJS({
61105
61473
  }
61106
61474
  function registerMutableSourceForHydration(root2, mutableSource) {
61107
61475
  var getVersion2 = mutableSource._getVersion;
61108
- var version = getVersion2(mutableSource._source);
61476
+ var version2 = getVersion2(mutableSource._source);
61109
61477
  if (root2.mutableSourceEagerHydrationData == null) {
61110
- root2.mutableSourceEagerHydrationData = [mutableSource, version];
61478
+ root2.mutableSourceEagerHydrationData = [mutableSource, version2];
61111
61479
  } else {
61112
- root2.mutableSourceEagerHydrationData.push(mutableSource, version);
61480
+ root2.mutableSourceEagerHydrationData.push(mutableSource, version2);
61113
61481
  }
61114
61482
  }
61115
61483
  var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher, ReactCurrentBatchConfig$2 = ReactSharedInternals.ReactCurrentBatchConfig;
@@ -71875,8 +72243,8 @@ var require_dist = __commonJS({
71875
72243
  };
71876
72244
  init_react_import2();
71877
72245
  init_react_import2();
71878
- var import_crypto = require("crypto");
71879
- var generateId = (type) => `${type}-${(0, import_crypto.randomBytes)(20).toString("hex")}`;
72246
+ var import_uuid = (init_esm_node(), __toCommonJS(esm_node_exports));
72247
+ var generateId = (type) => `${type}-${(0, import_uuid.v4)()}`;
71880
72248
  var reduceRelatedZones = (item, data, fn) => {
71881
72249
  return __spreadProps2(__spreadValues2({}, data), {
71882
72250
  zones: Object.keys(data.zones || {}).reduce(
@@ -73794,7 +74162,7 @@ var require_dist = __commonJS({
73794
74162
  overrides,
73795
74163
  plugins
73796
74164
  }) => {
73797
- const collected = overrides;
74165
+ const collected = __spreadValues2({}, overrides);
73798
74166
  plugins.forEach((plugin) => {
73799
74167
  Object.keys(plugin.overrides).forEach((overridesType) => {
73800
74168
  if (overridesType === "fieldTypes") {
package/package.json CHANGED
@@ -1,6 +1,10 @@
1
1
  {
2
2
  "name": "@measured/puck-plugin-heading-analyzer",
3
- "version": "0.14.0-canary.4932a6e",
3
+ "version": "0.14.0-canary.cbdf66d",
4
+ "author": "Measured Corporation Ltd <hello@measured.co>",
5
+ "repository": "measuredco/puck",
6
+ "bugs": "https://github.com/measuredco/puck/issues",
7
+ "homepage": "https://puckeditor.com",
4
8
  "private": false,
5
9
  "main": "./dist/index.js",
6
10
  "types": "./dist/index.d.ts",
@@ -14,7 +18,7 @@
14
18
  "dist"
15
19
  ],
16
20
  "devDependencies": {
17
- "@measured/puck": "^0.14.0-canary.4932a6e",
21
+ "@measured/puck": "^0.14.0-canary.cbdf66d",
18
22
  "@types/react": "^18.2.0",
19
23
  "@types/react-dom": "^18.2.0",
20
24
  "eslint": "^7.32.0",
@@ -24,7 +28,7 @@
24
28
  "typescript": "^4.5.2"
25
29
  },
26
30
  "dependencies": {
27
- "react-from-json": "^0.7.2"
31
+ "react-from-json": "^0.8.0"
28
32
  },
29
33
  "peerDependencies": {
30
34
  "react": "^17.0.0 || ^18.0.0"