@puckeditor/plugin-pages 0.10.0-canary.596c8fd5 → 0.10.0-canary.5bbc2ab4
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 +13 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +16 -3
- package/dist/index.mjs +16 -3
- package/package.json +4 -4
package/dist/index.d.mts
CHANGED
|
@@ -9,6 +9,11 @@ type RequestOptions = {
|
|
|
9
9
|
headers?: HeadersInit;
|
|
10
10
|
credentials?: RequestCredentials;
|
|
11
11
|
};
|
|
12
|
+
/**
|
|
13
|
+
* Options for `createPagesPlugin`.
|
|
14
|
+
*
|
|
15
|
+
* @experimental
|
|
16
|
+
*/
|
|
12
17
|
type PagePluginOptions = {
|
|
13
18
|
/** Where `puckHandler` serves the pages API. Defaults to `/api/puck/pages`. */
|
|
14
19
|
host?: string;
|
|
@@ -23,6 +28,14 @@ type PagePluginOptions = {
|
|
|
23
28
|
prepareRequest?: (opts: RequestOptions) => RequestOptions | Promise<RequestOptions>;
|
|
24
29
|
};
|
|
25
30
|
|
|
31
|
+
/**
|
|
32
|
+
* Create the pages plugin, for creating, editing and publishing Puck Cloud pages.
|
|
33
|
+
*
|
|
34
|
+
* @param opts The pages API host, site URL, first page and request options.
|
|
35
|
+
* @returns The plugin.
|
|
36
|
+
*
|
|
37
|
+
* @experimental
|
|
38
|
+
*/
|
|
26
39
|
declare function createPagesPlugin(opts?: PagePluginOptions): {
|
|
27
40
|
label: string;
|
|
28
41
|
name: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,11 @@ type RequestOptions = {
|
|
|
9
9
|
headers?: HeadersInit;
|
|
10
10
|
credentials?: RequestCredentials;
|
|
11
11
|
};
|
|
12
|
+
/**
|
|
13
|
+
* Options for `createPagesPlugin`.
|
|
14
|
+
*
|
|
15
|
+
* @experimental
|
|
16
|
+
*/
|
|
12
17
|
type PagePluginOptions = {
|
|
13
18
|
/** Where `puckHandler` serves the pages API. Defaults to `/api/puck/pages`. */
|
|
14
19
|
host?: string;
|
|
@@ -23,6 +28,14 @@ type PagePluginOptions = {
|
|
|
23
28
|
prepareRequest?: (opts: RequestOptions) => RequestOptions | Promise<RequestOptions>;
|
|
24
29
|
};
|
|
25
30
|
|
|
31
|
+
/**
|
|
32
|
+
* Create the pages plugin, for creating, editing and publishing Puck Cloud pages.
|
|
33
|
+
*
|
|
34
|
+
* @param opts The pages API host, site URL, first page and request options.
|
|
35
|
+
* @returns The plugin.
|
|
36
|
+
*
|
|
37
|
+
* @experimental
|
|
38
|
+
*/
|
|
26
39
|
declare function createPagesPlugin(opts?: PagePluginOptions): {
|
|
27
40
|
label: string;
|
|
28
41
|
name: string;
|
package/dist/index.js
CHANGED
|
@@ -4850,6 +4850,18 @@ var keepHeaderActions = (children) => isHeaderActions(children) ? (0, import_rea
|
|
|
4850
4850
|
children: keepHeaderActions(children.props.children)
|
|
4851
4851
|
}) : null;
|
|
4852
4852
|
|
|
4853
|
+
// ../utils/lib/warn-experimental.ts
|
|
4854
|
+
init_react_import();
|
|
4855
|
+
var warned = /* @__PURE__ */ new Set();
|
|
4856
|
+
var warnExperimental = (packageName, api) => {
|
|
4857
|
+
const key = `${packageName} ${api}`;
|
|
4858
|
+
if (warned.has(key)) return;
|
|
4859
|
+
warned.add(key);
|
|
4860
|
+
console.warn(
|
|
4861
|
+
`[${packageName}] ${api} is experimental and may change in a future release.`
|
|
4862
|
+
);
|
|
4863
|
+
};
|
|
4864
|
+
|
|
4853
4865
|
// src/components/PagePlugin/index.tsx
|
|
4854
4866
|
init_react_import();
|
|
4855
4867
|
|
|
@@ -9656,7 +9668,7 @@ var STYLE_SOURCE_VALUE = "puck";
|
|
|
9656
9668
|
var STYLE_ID_ATTRIBUTE = "data-puck-style-id";
|
|
9657
9669
|
var styleRegistry = /* @__PURE__ */ new WeakMap();
|
|
9658
9670
|
var staticCssDetected = /* @__PURE__ */ new Map();
|
|
9659
|
-
var
|
|
9671
|
+
var warned2 = /* @__PURE__ */ new Set();
|
|
9660
9672
|
var getStyleMap = (target) => {
|
|
9661
9673
|
const existing = styleRegistry.get(target);
|
|
9662
9674
|
if (existing) {
|
|
@@ -9734,10 +9746,10 @@ var useInjectPluginCss = (name) => {
|
|
|
9734
9746
|
skip || !runtimeStyles ? null : { cssText: runtimeStyles, id: name, prepend: true }
|
|
9735
9747
|
);
|
|
9736
9748
|
(0, import_react27.useEffect)(() => {
|
|
9737
|
-
if (!skip || process.env.NODE_ENV === "production" ||
|
|
9749
|
+
if (!skip || process.env.NODE_ENV === "production" || warned2.has(name)) {
|
|
9738
9750
|
return;
|
|
9739
9751
|
}
|
|
9740
|
-
|
|
9752
|
+
warned2.add(name);
|
|
9741
9753
|
console.info(
|
|
9742
9754
|
`Puck: Skipped runtime style injection as @puckeditor/${name} styles are already loaded. You can safely remove the "@puckeditor/${name}/styles.css" import, or ignore this message.`
|
|
9743
9755
|
);
|
|
@@ -10605,6 +10617,7 @@ var EditorLock = ({ children }) => {
|
|
|
10605
10617
|
// src/index.tsx
|
|
10606
10618
|
var import_jsx_runtime62 = require("react/jsx-runtime");
|
|
10607
10619
|
function createPagesPlugin(opts) {
|
|
10620
|
+
warnExperimental("@puckeditor/plugin-pages", "createPagesPlugin()");
|
|
10608
10621
|
return {
|
|
10609
10622
|
label: "Pages",
|
|
10610
10623
|
name: "pages",
|
package/dist/index.mjs
CHANGED
|
@@ -4845,6 +4845,18 @@ var keepHeaderActions = (children) => isHeaderActions(children) ? cloneElement2(
|
|
|
4845
4845
|
children: keepHeaderActions(children.props.children)
|
|
4846
4846
|
}) : null;
|
|
4847
4847
|
|
|
4848
|
+
// ../utils/lib/warn-experimental.ts
|
|
4849
|
+
init_react_import();
|
|
4850
|
+
var warned = /* @__PURE__ */ new Set();
|
|
4851
|
+
var warnExperimental = (packageName, api) => {
|
|
4852
|
+
const key = `${packageName} ${api}`;
|
|
4853
|
+
if (warned.has(key)) return;
|
|
4854
|
+
warned.add(key);
|
|
4855
|
+
console.warn(
|
|
4856
|
+
`[${packageName}] ${api} is experimental and may change in a future release.`
|
|
4857
|
+
);
|
|
4858
|
+
};
|
|
4859
|
+
|
|
4848
4860
|
// src/components/PagePlugin/index.tsx
|
|
4849
4861
|
init_react_import();
|
|
4850
4862
|
|
|
@@ -9654,7 +9666,7 @@ var STYLE_SOURCE_VALUE = "puck";
|
|
|
9654
9666
|
var STYLE_ID_ATTRIBUTE = "data-puck-style-id";
|
|
9655
9667
|
var styleRegistry = /* @__PURE__ */ new WeakMap();
|
|
9656
9668
|
var staticCssDetected = /* @__PURE__ */ new Map();
|
|
9657
|
-
var
|
|
9669
|
+
var warned2 = /* @__PURE__ */ new Set();
|
|
9658
9670
|
var getStyleMap = (target) => {
|
|
9659
9671
|
const existing = styleRegistry.get(target);
|
|
9660
9672
|
if (existing) {
|
|
@@ -9732,10 +9744,10 @@ var useInjectPluginCss = (name) => {
|
|
|
9732
9744
|
skip || !runtimeStyles ? null : { cssText: runtimeStyles, id: name, prepend: true }
|
|
9733
9745
|
);
|
|
9734
9746
|
useEffect30(() => {
|
|
9735
|
-
if (!skip || process.env.NODE_ENV === "production" ||
|
|
9747
|
+
if (!skip || process.env.NODE_ENV === "production" || warned2.has(name)) {
|
|
9736
9748
|
return;
|
|
9737
9749
|
}
|
|
9738
|
-
|
|
9750
|
+
warned2.add(name);
|
|
9739
9751
|
console.info(
|
|
9740
9752
|
`Puck: Skipped runtime style injection as @puckeditor/${name} styles are already loaded. You can safely remove the "@puckeditor/${name}/styles.css" import, or ignore this message.`
|
|
9741
9753
|
);
|
|
@@ -10603,6 +10615,7 @@ var EditorLock = ({ children }) => {
|
|
|
10603
10615
|
// src/index.tsx
|
|
10604
10616
|
import { Fragment as Fragment13, jsx as jsx55, jsxs as jsxs31 } from "react/jsx-runtime";
|
|
10605
10617
|
function createPagesPlugin(opts) {
|
|
10618
|
+
warnExperimental("@puckeditor/plugin-pages", "createPagesPlugin()");
|
|
10606
10619
|
return {
|
|
10607
10620
|
label: "Pages",
|
|
10608
10621
|
name: "pages",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@puckeditor/plugin-pages",
|
|
3
|
-
"version": "0.10.0-canary.
|
|
3
|
+
"version": "0.10.0-canary.5bbc2ab4",
|
|
4
4
|
"author": "Chris Villa <chris@puckeditor.com>",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -47,9 +47,9 @@
|
|
|
47
47
|
"typescript": "^5.5.4",
|
|
48
48
|
"vite-tsconfig-paths": "^5.1.4",
|
|
49
49
|
"vitest": "^4.1.12",
|
|
50
|
-
"
|
|
51
|
-
"
|
|
52
|
-
"
|
|
50
|
+
"tsconfig": "0.10.0-canary.5bbc2ab4",
|
|
51
|
+
"tsup-config": "0.10.0-canary.5bbc2ab4",
|
|
52
|
+
"eslint-config-custom": "0.10.0-canary.5bbc2ab4"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"@puckeditor/core": "^0",
|