@puckeditor/plugin-auth 0.9.0-canary.e9811666c → 0.9.0-canary.ef531ef9
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.css +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +47 -66
- package/dist/index.mjs +34 -50
- package/package.json +6 -6
package/dist/index.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/* css-module:/
|
|
1
|
+
/* css-module:/home/runner/work/platform/platform/packages/platform-client/components/Menu/styles.module.css/#css-module-data */
|
|
2
2
|
._Menu_1jr57_1 {
|
|
3
3
|
display: flex;
|
|
4
4
|
position: relative;
|
|
@@ -75,7 +75,7 @@ button._Menu-item_1jr57_55:hover {
|
|
|
75
75
|
opacity: 0.5;
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
/* css-module:/
|
|
78
|
+
/* css-module:/home/runner/work/platform/platform/packages/plugin-auth/src/components/SessionMenu/styles.module.css/#css-module-data */
|
|
79
79
|
._SessionMenu-avatar_j6dlr_1 {
|
|
80
80
|
display: inline-flex;
|
|
81
81
|
align-items: center;
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
3
|
|
|
4
4
|
type AuthPluginOptions = {
|
|
5
5
|
/** Where the app serves Sign in with Puck's routes. Defaults to /api/puck/auth. */
|
|
@@ -12,7 +12,7 @@ declare function createAuthPlugin({ host, showBranch, }?: AuthPluginOptions): {
|
|
|
12
12
|
name: string;
|
|
13
13
|
overrides: {
|
|
14
14
|
headerActions: ({ children }: {
|
|
15
|
-
children:
|
|
15
|
+
children: ReactNode;
|
|
16
16
|
}) => react_jsx_runtime.JSX.Element;
|
|
17
17
|
};
|
|
18
18
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
-
import
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
3
|
|
|
4
4
|
type AuthPluginOptions = {
|
|
5
5
|
/** Where the app serves Sign in with Puck's routes. Defaults to /api/puck/auth. */
|
|
@@ -12,7 +12,7 @@ declare function createAuthPlugin({ host, showBranch, }?: AuthPluginOptions): {
|
|
|
12
12
|
name: string;
|
|
13
13
|
overrides: {
|
|
14
14
|
headerActions: ({ children }: {
|
|
15
|
-
children:
|
|
15
|
+
children: ReactNode;
|
|
16
16
|
}) => react_jsx_runtime.JSX.Element;
|
|
17
17
|
};
|
|
18
18
|
};
|
package/dist/index.js
CHANGED
|
@@ -115,14 +115,20 @@ init_react_import();
|
|
|
115
115
|
// src/index.tsx
|
|
116
116
|
init_react_import();
|
|
117
117
|
|
|
118
|
+
// ../platform-client/lib/header-actions.ts
|
|
119
|
+
init_react_import();
|
|
120
|
+
var import_react2 = require("react");
|
|
121
|
+
var HEADER_ACTIONS = Symbol.for("@puckeditor/header-actions");
|
|
122
|
+
var markHeaderActions = (Component) => Object.assign(Component, { [HEADER_ACTIONS]: true });
|
|
123
|
+
|
|
118
124
|
// src/components/SessionMenu/index.tsx
|
|
119
125
|
init_react_import();
|
|
120
126
|
|
|
121
127
|
// ../platform-client/components/Menu/index.tsx
|
|
122
128
|
init_react_import();
|
|
123
|
-
var
|
|
129
|
+
var import_react5 = require("react");
|
|
124
130
|
|
|
125
|
-
// css-module:/
|
|
131
|
+
// css-module:/home/runner/work/platform/platform/packages/platform-client/components/Menu/styles.module.css#css-module
|
|
126
132
|
init_react_import();
|
|
127
133
|
var styles_module_default = { "Menu": "_Menu_1jr57_1", "Menu-content": "_Menu-content_1jr57_6", "Menu-sections": "_Menu-sections_1jr57_11", "Menu-action": "_Menu-action_1jr57_22", "Menu-list": "_Menu-list_1jr57_44", "Menu-item": "_Menu-item_1jr57_55", "Menu-item--disabled": "_Menu-item--disabled_1jr57_84" };
|
|
128
134
|
|
|
@@ -2512,12 +2518,12 @@ var computePosition2 = (reference, floating, options) => {
|
|
|
2512
2518
|
|
|
2513
2519
|
// ../../node_modules/.pnpm/@floating-ui+react-dom@2.1.5_react-dom@19.2.8_react@19.2.8__react@19.2.8/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.mjs
|
|
2514
2520
|
var React13 = __toESM(require("react"), 1);
|
|
2515
|
-
var
|
|
2521
|
+
var import_react3 = require("react");
|
|
2516
2522
|
var ReactDOM2 = __toESM(require("react-dom"), 1);
|
|
2517
2523
|
var isClient = typeof document !== "undefined";
|
|
2518
2524
|
var noop = function noop2() {
|
|
2519
2525
|
};
|
|
2520
|
-
var index = isClient ?
|
|
2526
|
+
var index = isClient ? import_react3.useLayoutEffect : noop;
|
|
2521
2527
|
function deepEqual(a, b) {
|
|
2522
2528
|
if (a === b) {
|
|
2523
2529
|
return true;
|
|
@@ -3530,9 +3536,9 @@ function assignRef(ref, value) {
|
|
|
3530
3536
|
|
|
3531
3537
|
// ../../node_modules/.pnpm/use-callback-ref@1.3.3_@types+react@19.2.0_react@19.2.8/node_modules/use-callback-ref/dist/es2015/useRef.js
|
|
3532
3538
|
init_react_import();
|
|
3533
|
-
var
|
|
3539
|
+
var import_react4 = require("react");
|
|
3534
3540
|
function useCallbackRef2(initialValue, callback) {
|
|
3535
|
-
var ref = (0,
|
|
3541
|
+
var ref = (0, import_react4.useState)(function() {
|
|
3536
3542
|
return {
|
|
3537
3543
|
// value
|
|
3538
3544
|
value: initialValue,
|
|
@@ -4508,7 +4514,7 @@ var Menu = ({
|
|
|
4508
4514
|
ariaLabel,
|
|
4509
4515
|
renderLink
|
|
4510
4516
|
}) => {
|
|
4511
|
-
const [open, setOpen] = (0,
|
|
4517
|
+
const [open, setOpen] = (0, import_react5.useState)(false);
|
|
4512
4518
|
return /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(Popover, { open, onOpenChange: setOpen, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsxs)("div", { className: getClassName(), children: [
|
|
4513
4519
|
/* @__PURE__ */ (0, import_jsx_runtime10.jsx)(PopoverTrigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime10.jsx)(
|
|
4514
4520
|
"button",
|
|
@@ -4626,7 +4632,7 @@ init_react_import();
|
|
|
4626
4632
|
|
|
4627
4633
|
// ../../node_modules/.pnpm/lucide-react@0.554.0_react@19.2.8/node_modules/lucide-react/dist/esm/createLucideIcon.js
|
|
4628
4634
|
init_react_import();
|
|
4629
|
-
var
|
|
4635
|
+
var import_react7 = require("react");
|
|
4630
4636
|
|
|
4631
4637
|
// ../../node_modules/.pnpm/lucide-react@0.554.0_react@19.2.8/node_modules/lucide-react/dist/esm/shared/src/utils.js
|
|
4632
4638
|
init_react_import();
|
|
@@ -4652,7 +4658,7 @@ var hasA11yProp = (props) => {
|
|
|
4652
4658
|
|
|
4653
4659
|
// ../../node_modules/.pnpm/lucide-react@0.554.0_react@19.2.8/node_modules/lucide-react/dist/esm/Icon.js
|
|
4654
4660
|
init_react_import();
|
|
4655
|
-
var
|
|
4661
|
+
var import_react6 = require("react");
|
|
4656
4662
|
|
|
4657
4663
|
// ../../node_modules/.pnpm/lucide-react@0.554.0_react@19.2.8/node_modules/lucide-react/dist/esm/defaultAttributes.js
|
|
4658
4664
|
init_react_import();
|
|
@@ -4669,7 +4675,7 @@ var defaultAttributes = {
|
|
|
4669
4675
|
};
|
|
4670
4676
|
|
|
4671
4677
|
// ../../node_modules/.pnpm/lucide-react@0.554.0_react@19.2.8/node_modules/lucide-react/dist/esm/Icon.js
|
|
4672
|
-
var Icon = (0,
|
|
4678
|
+
var Icon = (0, import_react6.forwardRef)(
|
|
4673
4679
|
({
|
|
4674
4680
|
color = "currentColor",
|
|
4675
4681
|
size: size4 = 24,
|
|
@@ -4679,7 +4685,7 @@ var Icon = (0, import_react5.forwardRef)(
|
|
|
4679
4685
|
children,
|
|
4680
4686
|
iconNode,
|
|
4681
4687
|
...rest
|
|
4682
|
-
}, ref) => (0,
|
|
4688
|
+
}, ref) => (0, import_react6.createElement)(
|
|
4683
4689
|
"svg",
|
|
4684
4690
|
{
|
|
4685
4691
|
ref,
|
|
@@ -4693,7 +4699,7 @@ var Icon = (0, import_react5.forwardRef)(
|
|
|
4693
4699
|
...rest
|
|
4694
4700
|
},
|
|
4695
4701
|
[
|
|
4696
|
-
...iconNode.map(([tag, attrs]) => (0,
|
|
4702
|
+
...iconNode.map(([tag, attrs]) => (0, import_react6.createElement)(tag, attrs)),
|
|
4697
4703
|
...Array.isArray(children) ? children : [children]
|
|
4698
4704
|
]
|
|
4699
4705
|
)
|
|
@@ -4701,8 +4707,8 @@ var Icon = (0, import_react5.forwardRef)(
|
|
|
4701
4707
|
|
|
4702
4708
|
// ../../node_modules/.pnpm/lucide-react@0.554.0_react@19.2.8/node_modules/lucide-react/dist/esm/createLucideIcon.js
|
|
4703
4709
|
var createLucideIcon = (iconName, iconNode) => {
|
|
4704
|
-
const Component = (0,
|
|
4705
|
-
({ className, ...props }, ref) => (0,
|
|
4710
|
+
const Component = (0, import_react7.forwardRef)(
|
|
4711
|
+
({ className, ...props }, ref) => (0, import_react7.createElement)(Icon, {
|
|
4706
4712
|
ref,
|
|
4707
4713
|
iconNode,
|
|
4708
4714
|
className: mergeClasses(
|
|
@@ -4717,38 +4723,29 @@ var createLucideIcon = (iconName, iconNode) => {
|
|
|
4717
4723
|
return Component;
|
|
4718
4724
|
};
|
|
4719
4725
|
|
|
4720
|
-
// ../../node_modules/.pnpm/lucide-react@0.554.0_react@19.2.8/node_modules/lucide-react/dist/esm/icons/external-link.js
|
|
4721
|
-
init_react_import();
|
|
4722
|
-
var __iconNode = [
|
|
4723
|
-
["path", { d: "M15 3h6v6", key: "1q9fwt" }],
|
|
4724
|
-
["path", { d: "M10 14 21 3", key: "gplh6r" }],
|
|
4725
|
-
["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
|
|
4726
|
-
];
|
|
4727
|
-
var ExternalLink = createLucideIcon("external-link", __iconNode);
|
|
4728
|
-
|
|
4729
4726
|
// ../../node_modules/.pnpm/lucide-react@0.554.0_react@19.2.8/node_modules/lucide-react/dist/esm/icons/git-branch.js
|
|
4730
4727
|
init_react_import();
|
|
4731
|
-
var
|
|
4728
|
+
var __iconNode = [
|
|
4732
4729
|
["line", { x1: "6", x2: "6", y1: "3", y2: "15", key: "17qcm7" }],
|
|
4733
4730
|
["circle", { cx: "18", cy: "6", r: "3", key: "1h7g24" }],
|
|
4734
4731
|
["circle", { cx: "6", cy: "18", r: "3", key: "fqmcym" }],
|
|
4735
4732
|
["path", { d: "M18 9a9 9 0 0 1-9 9", key: "n2h4wq" }]
|
|
4736
4733
|
];
|
|
4737
|
-
var GitBranch = createLucideIcon("git-branch",
|
|
4734
|
+
var GitBranch = createLucideIcon("git-branch", __iconNode);
|
|
4738
4735
|
|
|
4739
4736
|
// ../../node_modules/.pnpm/lucide-react@0.554.0_react@19.2.8/node_modules/lucide-react/dist/esm/icons/log-out.js
|
|
4740
4737
|
init_react_import();
|
|
4741
|
-
var
|
|
4738
|
+
var __iconNode2 = [
|
|
4742
4739
|
["path", { d: "m16 17 5-5-5-5", key: "1bji2h" }],
|
|
4743
4740
|
["path", { d: "M21 12H9", key: "dn1m92" }],
|
|
4744
4741
|
["path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4", key: "1uf3rs" }]
|
|
4745
4742
|
];
|
|
4746
|
-
var LogOut = createLucideIcon("log-out",
|
|
4743
|
+
var LogOut = createLucideIcon("log-out", __iconNode2);
|
|
4747
4744
|
|
|
4748
4745
|
// src/components/SessionMenu/index.tsx
|
|
4749
|
-
var
|
|
4746
|
+
var import_react8 = require("react");
|
|
4750
4747
|
|
|
4751
|
-
// css-module:/
|
|
4748
|
+
// css-module:/home/runner/work/platform/platform/packages/plugin-auth/src/components/SessionMenu/styles.module.css#css-module
|
|
4752
4749
|
init_react_import();
|
|
4753
4750
|
var styles_module_default2 = { "SessionMenu-avatar": "_SessionMenu-avatar_j6dlr_1", "SessionMenu-placeholder": "_SessionMenu-placeholder_j6dlr_16", "SessionMenu-identity": "_SessionMenu-identity_j6dlr_30", "SessionMenu-name": "_SessionMenu-name_j6dlr_37", "SessionMenu-email": "_SessionMenu-email_j6dlr_41" };
|
|
4754
4751
|
|
|
@@ -4760,8 +4757,8 @@ var SessionMenu = ({
|
|
|
4760
4757
|
authHost,
|
|
4761
4758
|
showBranch
|
|
4762
4759
|
}) => {
|
|
4763
|
-
const [session, setSession] = (0,
|
|
4764
|
-
(0,
|
|
4760
|
+
const [session, setSession] = (0, import_react8.useState)();
|
|
4761
|
+
(0, import_react8.useEffect)(() => {
|
|
4765
4762
|
let cancelled = false;
|
|
4766
4763
|
fetch(`${authHost}/session`, { cache: "no-store" }).then((response) => response.ok ? response.json() : null).then((data) => {
|
|
4767
4764
|
if (!cancelled) setSession(data?.user ? data : null);
|
|
@@ -4787,18 +4784,6 @@ var SessionMenu = ({
|
|
|
4787
4784
|
Menu,
|
|
4788
4785
|
{
|
|
4789
4786
|
ariaLabel: "Account",
|
|
4790
|
-
renderLink: ({ href, className, children, onClick }) => /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(
|
|
4791
|
-
"a",
|
|
4792
|
-
{
|
|
4793
|
-
className,
|
|
4794
|
-
href,
|
|
4795
|
-
onClick,
|
|
4796
|
-
rel: "noreferrer",
|
|
4797
|
-
role: "menuitem",
|
|
4798
|
-
target: "_blank",
|
|
4799
|
-
children
|
|
4800
|
-
}
|
|
4801
|
-
),
|
|
4802
4787
|
sections: [
|
|
4803
4788
|
[
|
|
4804
4789
|
{
|
|
@@ -4816,26 +4801,25 @@ var SessionMenu = ({
|
|
|
4816
4801
|
}
|
|
4817
4802
|
] : []
|
|
4818
4803
|
],
|
|
4819
|
-
[
|
|
4820
|
-
{
|
|
4821
|
-
href: session.cloudUrl,
|
|
4822
|
-
icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(ExternalLink, { size: 16 }),
|
|
4823
|
-
label: "Open Puck Cloud"
|
|
4824
|
-
},
|
|
4825
|
-
{ icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(LogOut, { size: 16 }), label: "Sign out", onClick: signOut }
|
|
4826
|
-
]
|
|
4804
|
+
[{ icon: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)(LogOut, { size: 16 }), label: "Sign out", onClick: signOut }]
|
|
4827
4805
|
],
|
|
4828
4806
|
children: /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("span", { className: cx("avatar"), title: session.user.name, children: session.user.image ? /* @__PURE__ */ (0, import_jsx_runtime11.jsx)("img", { alt: "", src: session.user.image }) : initials(session.user.name) || "?" })
|
|
4829
4807
|
}
|
|
4830
4808
|
);
|
|
4831
4809
|
};
|
|
4832
4810
|
|
|
4833
|
-
// src/lib/is-embedded.ts
|
|
4834
|
-
init_react_import();
|
|
4835
|
-
var isEmbedded = () => typeof window !== "undefined" && window.self !== window.top;
|
|
4836
|
-
|
|
4837
4811
|
// src/index.tsx
|
|
4838
4812
|
var import_jsx_runtime12 = require("react/jsx-runtime");
|
|
4813
|
+
var AuthHeaderActions = markHeaderActions(
|
|
4814
|
+
({
|
|
4815
|
+
children,
|
|
4816
|
+
authHost,
|
|
4817
|
+
showBranch
|
|
4818
|
+
}) => /* @__PURE__ */ (0, import_jsx_runtime12.jsxs)(import_jsx_runtime12.Fragment, { children: [
|
|
4819
|
+
children,
|
|
4820
|
+
/* @__PURE__ */ (0, import_jsx_runtime12.jsx)(SessionMenu, { authHost, showBranch })
|
|
4821
|
+
] })
|
|
4822
|
+
);
|
|
4839
4823
|
function createAuthPlugin({
|
|
4840
4824
|
host = "/api/puck/auth",
|
|
4841
4825
|
showBranch = process.env.NODE_ENV === "development"
|
|
@@ -4843,16 +4827,14 @@ function createAuthPlugin({
|
|
|
4843
4827
|
return {
|
|
4844
4828
|
name: "auth",
|
|
4845
4829
|
overrides: {
|
|
4846
|
-
headerActions: ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime12.
|
|
4847
|
-
|
|
4848
|
-
|
|
4849
|
-
|
|
4850
|
-
|
|
4851
|
-
|
|
4852
|
-
|
|
4853
|
-
|
|
4854
|
-
)
|
|
4855
|
-
] })
|
|
4830
|
+
headerActions: ({ children }) => /* @__PURE__ */ (0, import_jsx_runtime12.jsx)(
|
|
4831
|
+
AuthHeaderActions,
|
|
4832
|
+
{
|
|
4833
|
+
authHost: host.replace(/\/+$/, ""),
|
|
4834
|
+
showBranch,
|
|
4835
|
+
children
|
|
4836
|
+
}
|
|
4837
|
+
)
|
|
4856
4838
|
}
|
|
4857
4839
|
};
|
|
4858
4840
|
}
|
|
@@ -4873,7 +4855,6 @@ lucide-react/dist/esm/shared/src/utils.js:
|
|
|
4873
4855
|
lucide-react/dist/esm/defaultAttributes.js:
|
|
4874
4856
|
lucide-react/dist/esm/Icon.js:
|
|
4875
4857
|
lucide-react/dist/esm/createLucideIcon.js:
|
|
4876
|
-
lucide-react/dist/esm/icons/external-link.js:
|
|
4877
4858
|
lucide-react/dist/esm/icons/git-branch.js:
|
|
4878
4859
|
lucide-react/dist/esm/icons/log-out.js:
|
|
4879
4860
|
lucide-react/dist/esm/lucide-react.js:
|
package/dist/index.mjs
CHANGED
|
@@ -103,6 +103,15 @@ init_react_import();
|
|
|
103
103
|
// src/index.tsx
|
|
104
104
|
init_react_import();
|
|
105
105
|
|
|
106
|
+
// ../platform-client/lib/header-actions.ts
|
|
107
|
+
init_react_import();
|
|
108
|
+
import {
|
|
109
|
+
cloneElement,
|
|
110
|
+
isValidElement
|
|
111
|
+
} from "react";
|
|
112
|
+
var HEADER_ACTIONS = Symbol.for("@puckeditor/header-actions");
|
|
113
|
+
var markHeaderActions = (Component) => Object.assign(Component, { [HEADER_ACTIONS]: true });
|
|
114
|
+
|
|
106
115
|
// src/components/SessionMenu/index.tsx
|
|
107
116
|
init_react_import();
|
|
108
117
|
|
|
@@ -110,7 +119,7 @@ init_react_import();
|
|
|
110
119
|
init_react_import();
|
|
111
120
|
import { useState as useState14 } from "react";
|
|
112
121
|
|
|
113
|
-
// css-module:/
|
|
122
|
+
// css-module:/home/runner/work/platform/platform/packages/platform-client/components/Menu/styles.module.css#css-module
|
|
114
123
|
init_react_import();
|
|
115
124
|
var styles_module_default = { "Menu": "_Menu_1jr57_1", "Menu-content": "_Menu-content_1jr57_6", "Menu-sections": "_Menu-sections_1jr57_11", "Menu-action": "_Menu-action_1jr57_22", "Menu-list": "_Menu-list_1jr57_44", "Menu-item": "_Menu-item_1jr57_55", "Menu-item--disabled": "_Menu-item--disabled_1jr57_84" };
|
|
116
125
|
|
|
@@ -4705,38 +4714,29 @@ var createLucideIcon = (iconName, iconNode) => {
|
|
|
4705
4714
|
return Component;
|
|
4706
4715
|
};
|
|
4707
4716
|
|
|
4708
|
-
// ../../node_modules/.pnpm/lucide-react@0.554.0_react@19.2.8/node_modules/lucide-react/dist/esm/icons/external-link.js
|
|
4709
|
-
init_react_import();
|
|
4710
|
-
var __iconNode = [
|
|
4711
|
-
["path", { d: "M15 3h6v6", key: "1q9fwt" }],
|
|
4712
|
-
["path", { d: "M10 14 21 3", key: "gplh6r" }],
|
|
4713
|
-
["path", { d: "M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6", key: "a6xqqp" }]
|
|
4714
|
-
];
|
|
4715
|
-
var ExternalLink = createLucideIcon("external-link", __iconNode);
|
|
4716
|
-
|
|
4717
4717
|
// ../../node_modules/.pnpm/lucide-react@0.554.0_react@19.2.8/node_modules/lucide-react/dist/esm/icons/git-branch.js
|
|
4718
4718
|
init_react_import();
|
|
4719
|
-
var
|
|
4719
|
+
var __iconNode = [
|
|
4720
4720
|
["line", { x1: "6", x2: "6", y1: "3", y2: "15", key: "17qcm7" }],
|
|
4721
4721
|
["circle", { cx: "18", cy: "6", r: "3", key: "1h7g24" }],
|
|
4722
4722
|
["circle", { cx: "6", cy: "18", r: "3", key: "fqmcym" }],
|
|
4723
4723
|
["path", { d: "M18 9a9 9 0 0 1-9 9", key: "n2h4wq" }]
|
|
4724
4724
|
];
|
|
4725
|
-
var GitBranch = createLucideIcon("git-branch",
|
|
4725
|
+
var GitBranch = createLucideIcon("git-branch", __iconNode);
|
|
4726
4726
|
|
|
4727
4727
|
// ../../node_modules/.pnpm/lucide-react@0.554.0_react@19.2.8/node_modules/lucide-react/dist/esm/icons/log-out.js
|
|
4728
4728
|
init_react_import();
|
|
4729
|
-
var
|
|
4729
|
+
var __iconNode2 = [
|
|
4730
4730
|
["path", { d: "m16 17 5-5-5-5", key: "1bji2h" }],
|
|
4731
4731
|
["path", { d: "M21 12H9", key: "dn1m92" }],
|
|
4732
4732
|
["path", { d: "M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4", key: "1uf3rs" }]
|
|
4733
4733
|
];
|
|
4734
|
-
var LogOut = createLucideIcon("log-out",
|
|
4734
|
+
var LogOut = createLucideIcon("log-out", __iconNode2);
|
|
4735
4735
|
|
|
4736
4736
|
// src/components/SessionMenu/index.tsx
|
|
4737
4737
|
import { useEffect as useEffect15, useState as useState15 } from "react";
|
|
4738
4738
|
|
|
4739
|
-
// css-module:/
|
|
4739
|
+
// css-module:/home/runner/work/platform/platform/packages/plugin-auth/src/components/SessionMenu/styles.module.css#css-module
|
|
4740
4740
|
init_react_import();
|
|
4741
4741
|
var styles_module_default2 = { "SessionMenu-avatar": "_SessionMenu-avatar_j6dlr_1", "SessionMenu-placeholder": "_SessionMenu-placeholder_j6dlr_16", "SessionMenu-identity": "_SessionMenu-identity_j6dlr_30", "SessionMenu-name": "_SessionMenu-name_j6dlr_37", "SessionMenu-email": "_SessionMenu-email_j6dlr_41" };
|
|
4742
4742
|
|
|
@@ -4775,18 +4775,6 @@ var SessionMenu = ({
|
|
|
4775
4775
|
Menu,
|
|
4776
4776
|
{
|
|
4777
4777
|
ariaLabel: "Account",
|
|
4778
|
-
renderLink: ({ href, className, children, onClick }) => /* @__PURE__ */ jsx11(
|
|
4779
|
-
"a",
|
|
4780
|
-
{
|
|
4781
|
-
className,
|
|
4782
|
-
href,
|
|
4783
|
-
onClick,
|
|
4784
|
-
rel: "noreferrer",
|
|
4785
|
-
role: "menuitem",
|
|
4786
|
-
target: "_blank",
|
|
4787
|
-
children
|
|
4788
|
-
}
|
|
4789
|
-
),
|
|
4790
4778
|
sections: [
|
|
4791
4779
|
[
|
|
4792
4780
|
{
|
|
@@ -4804,26 +4792,25 @@ var SessionMenu = ({
|
|
|
4804
4792
|
}
|
|
4805
4793
|
] : []
|
|
4806
4794
|
],
|
|
4807
|
-
[
|
|
4808
|
-
{
|
|
4809
|
-
href: session.cloudUrl,
|
|
4810
|
-
icon: /* @__PURE__ */ jsx11(ExternalLink, { size: 16 }),
|
|
4811
|
-
label: "Open Puck Cloud"
|
|
4812
|
-
},
|
|
4813
|
-
{ icon: /* @__PURE__ */ jsx11(LogOut, { size: 16 }), label: "Sign out", onClick: signOut }
|
|
4814
|
-
]
|
|
4795
|
+
[{ icon: /* @__PURE__ */ jsx11(LogOut, { size: 16 }), label: "Sign out", onClick: signOut }]
|
|
4815
4796
|
],
|
|
4816
4797
|
children: /* @__PURE__ */ jsx11("span", { className: cx("avatar"), title: session.user.name, children: session.user.image ? /* @__PURE__ */ jsx11("img", { alt: "", src: session.user.image }) : initials(session.user.name) || "?" })
|
|
4817
4798
|
}
|
|
4818
4799
|
);
|
|
4819
4800
|
};
|
|
4820
4801
|
|
|
4821
|
-
// src/lib/is-embedded.ts
|
|
4822
|
-
init_react_import();
|
|
4823
|
-
var isEmbedded = () => typeof window !== "undefined" && window.self !== window.top;
|
|
4824
|
-
|
|
4825
4802
|
// src/index.tsx
|
|
4826
4803
|
import { Fragment as Fragment6, jsx as jsx12, jsxs as jsxs3 } from "react/jsx-runtime";
|
|
4804
|
+
var AuthHeaderActions = markHeaderActions(
|
|
4805
|
+
({
|
|
4806
|
+
children,
|
|
4807
|
+
authHost,
|
|
4808
|
+
showBranch
|
|
4809
|
+
}) => /* @__PURE__ */ jsxs3(Fragment6, { children: [
|
|
4810
|
+
children,
|
|
4811
|
+
/* @__PURE__ */ jsx12(SessionMenu, { authHost, showBranch })
|
|
4812
|
+
] })
|
|
4813
|
+
);
|
|
4827
4814
|
function createAuthPlugin({
|
|
4828
4815
|
host = "/api/puck/auth",
|
|
4829
4816
|
showBranch = process.env.NODE_ENV === "development"
|
|
@@ -4831,16 +4818,14 @@ function createAuthPlugin({
|
|
|
4831
4818
|
return {
|
|
4832
4819
|
name: "auth",
|
|
4833
4820
|
overrides: {
|
|
4834
|
-
headerActions: ({ children }) => /* @__PURE__ */
|
|
4835
|
-
|
|
4836
|
-
|
|
4837
|
-
|
|
4838
|
-
|
|
4839
|
-
|
|
4840
|
-
|
|
4841
|
-
|
|
4842
|
-
)
|
|
4843
|
-
] })
|
|
4821
|
+
headerActions: ({ children }) => /* @__PURE__ */ jsx12(
|
|
4822
|
+
AuthHeaderActions,
|
|
4823
|
+
{
|
|
4824
|
+
authHost: host.replace(/\/+$/, ""),
|
|
4825
|
+
showBranch,
|
|
4826
|
+
children
|
|
4827
|
+
}
|
|
4828
|
+
)
|
|
4844
4829
|
}
|
|
4845
4830
|
};
|
|
4846
4831
|
}
|
|
@@ -4860,7 +4845,6 @@ lucide-react/dist/esm/shared/src/utils.js:
|
|
|
4860
4845
|
lucide-react/dist/esm/defaultAttributes.js:
|
|
4861
4846
|
lucide-react/dist/esm/Icon.js:
|
|
4862
4847
|
lucide-react/dist/esm/createLucideIcon.js:
|
|
4863
|
-
lucide-react/dist/esm/icons/external-link.js:
|
|
4864
4848
|
lucide-react/dist/esm/icons/git-branch.js:
|
|
4865
4849
|
lucide-react/dist/esm/icons/log-out.js:
|
|
4866
4850
|
lucide-react/dist/esm/lucide-react.js:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@puckeditor/plugin-auth",
|
|
3
|
-
"version": "0.9.0-canary.
|
|
3
|
+
"version": "0.9.0-canary.ef531ef9",
|
|
4
4
|
"author": "Chris Villa <chris@puckeditor.com>",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"dist"
|
|
26
26
|
],
|
|
27
27
|
"devDependencies": {
|
|
28
|
-
"@puckeditor/core": "0.24.
|
|
28
|
+
"@puckeditor/core": "0.24.1-canary.2978ed6a",
|
|
29
29
|
"@testing-library/dom": "^10.4.1",
|
|
30
30
|
"@testing-library/react": "^16.3.2",
|
|
31
31
|
"@types/jest": "^30.0.0",
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
"typescript": "^5.5.4",
|
|
40
40
|
"vite-tsconfig-paths": "^5.1.4",
|
|
41
41
|
"vitest": "^4.1.11",
|
|
42
|
-
"
|
|
43
|
-
"
|
|
44
|
-
"tsup-config": "0.9.0-canary.
|
|
42
|
+
"tsconfig": "0.9.0-canary.ef531ef9",
|
|
43
|
+
"eslint-config-custom": "0.9.0-canary.ef531ef9",
|
|
44
|
+
"tsup-config": "0.9.0-canary.ef531ef9"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
|
-
"@puckeditor/core": "^0
|
|
47
|
+
"@puckeditor/core": "^0",
|
|
48
48
|
"react": "^18.0.0 || ^19.0.0"
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|