@webround/core 0.1.7
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/WrButton.d.ts +8 -0
- package/dist/WrButton.d.ts.map +1 -0
- package/dist/WrButton.js +7 -0
- package/dist/WrButton.js.map +1 -0
- package/dist/WrImage.d.ts +8 -0
- package/dist/WrImage.d.ts.map +1 -0
- package/dist/WrImage.js +7 -0
- package/dist/WrImage.js.map +1 -0
- package/dist/WrLink.d.ts +10 -0
- package/dist/WrLink.d.ts.map +1 -0
- package/dist/WrLink.js +15 -0
- package/dist/WrLink.js.map +1 -0
- package/dist/WrPageContext.d.ts +8 -0
- package/dist/WrPageContext.d.ts.map +1 -0
- package/dist/WrPageContext.js +11 -0
- package/dist/WrPageContext.js.map +1 -0
- package/dist/WrSection.d.ts +11 -0
- package/dist/WrSection.d.ts.map +1 -0
- package/dist/WrSection.js +5 -0
- package/dist/WrSection.js.map +1 -0
- package/dist/WrText.d.ts +11 -0
- package/dist/WrText.d.ts.map +1 -0
- package/dist/WrText.js +7 -0
- package/dist/WrText.js.map +1 -0
- package/dist/WrVideo.d.ts +9 -0
- package/dist/WrVideo.d.ts.map +1 -0
- package/dist/WrVideo.js +42 -0
- package/dist/WrVideo.js.map +1 -0
- package/dist/bridge.d.ts +2 -0
- package/dist/bridge.d.ts.map +1 -0
- package/dist/bridge.js +110 -0
- package/dist/bridge.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/types.d.ts +34 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +2 -0
- package/dist/types.js.map +1 -0
- package/package.json +34 -0
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface WrButtonOwnProps {
|
|
3
|
+
id: string;
|
|
4
|
+
}
|
|
5
|
+
type WrButtonProps = WrButtonOwnProps & Omit<React.ComponentPropsWithoutRef<'button'>, 'id'>;
|
|
6
|
+
export declare function WrButton({ id, children, ...props }: WrButtonProps): React.ReactElement;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=WrButton.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WrButton.d.ts","sourceRoot":"","sources":["../src/WrButton.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,UAAU,gBAAgB;IACtB,EAAE,EAAE,MAAM,CAAC;CACd;AAED,KAAK,aAAa,GAAG,gBAAgB,GAAG,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,QAAQ,CAAC,EAAE,IAAI,CAAC,CAAC;AAE7F,wBAAgB,QAAQ,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,aAAa,GAAG,KAAK,CAAC,YAAY,CAQtF"}
|
package/dist/WrButton.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useWrPage } from './WrPageContext';
|
|
3
|
+
export function WrButton({ id, children, ...props }) {
|
|
4
|
+
const config = useWrPage(id);
|
|
5
|
+
return (_jsx("button", { "data-wr-id": id, "data-wr-type": "button", ...props, children: config?.content ?? children }));
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=WrButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WrButton.js","sourceRoot":"","sources":["../src/WrButton.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAS5C,MAAM,UAAU,QAAQ,CAAC,EAAE,EAAE,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAiB;IAC9D,MAAM,MAAM,GAAG,SAAS,CAAC,EAAE,CAA+B,CAAC;IAE3D,OAAO,CACH,+BAAoB,EAAE,kBAAe,QAAQ,KAAK,KAAK,YAClD,MAAM,EAAE,OAAO,IAAI,QAAQ,GACvB,CACZ,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface WrImageOwnProps {
|
|
3
|
+
id: string;
|
|
4
|
+
}
|
|
5
|
+
type WrImageProps = WrImageOwnProps & Omit<React.ComponentPropsWithoutRef<'img'>, 'id'>;
|
|
6
|
+
export declare function WrImage({ id, ...props }: WrImageProps): React.ReactElement;
|
|
7
|
+
export {};
|
|
8
|
+
//# sourceMappingURL=WrImage.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WrImage.d.ts","sourceRoot":"","sources":["../src/WrImage.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,UAAU,eAAe;IAAG,EAAE,EAAE,MAAM,CAAC;CAAE;AACzC,KAAK,YAAY,GAAG,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,IAAI,CAAC,CAAC;AAExF,wBAAgB,OAAO,CAAC,EAAE,EAAE,EAAE,GAAG,KAAK,EAAE,EAAE,YAAY,GAAG,KAAK,CAAC,YAAY,CAG1E"}
|
package/dist/WrImage.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useWrPage } from './WrPageContext';
|
|
3
|
+
export function WrImage({ id, ...props }) {
|
|
4
|
+
const config = useWrPage(id);
|
|
5
|
+
return _jsx("img", { src: config?.src, alt: config?.alt ?? '', "data-wr-id": id, "data-wr-type": "image", ...props });
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=WrImage.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WrImage.js","sourceRoot":"","sources":["../src/WrImage.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAM5C,MAAM,UAAU,OAAO,CAAC,EAAE,EAAE,EAAE,GAAG,KAAK,EAAgB;IAClD,MAAM,MAAM,GAAG,SAAS,CAAC,EAAE,CAA8B,CAAC;IAC1D,OAAO,cAAK,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,gBAAc,EAAE,kBAAe,OAAO,KAAK,KAAK,GAAI,CAAC;AAC7G,CAAC"}
|
package/dist/WrLink.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface WrLinkOwnProps {
|
|
3
|
+
id: string;
|
|
4
|
+
href?: string;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
type WrLinkProps = WrLinkOwnProps & Omit<React.ComponentPropsWithoutRef<'a'>, 'id'>;
|
|
8
|
+
export declare function WrLink({ id, href, children, target, rel, ...props }: WrLinkProps): React.ReactElement;
|
|
9
|
+
export {};
|
|
10
|
+
//# sourceMappingURL=WrLink.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WrLink.d.ts","sourceRoot":"","sources":["../src/WrLink.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,UAAU,cAAc;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B;AAED,KAAK,WAAW,GAAG,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,GAAG,CAAC,EAAE,IAAI,CAAC,CAAC;AAEpF,wBAAgB,MAAM,CAAC,EAAE,EAAE,EAAE,IAAU,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,KAAK,EAAE,EAAE,WAAW,GAAG,KAAK,CAAC,YAAY,CAoB3G"}
|
package/dist/WrLink.js
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { Link } from 'react-router';
|
|
3
|
+
import { useWrPage } from './WrPageContext';
|
|
4
|
+
export function WrLink({ id, href = '#', children, target, rel, ...props }) {
|
|
5
|
+
const config = useWrPage(id);
|
|
6
|
+
const resolvedHref = config?.href ?? href ?? '#';
|
|
7
|
+
const content = config?.content;
|
|
8
|
+
const inner = content ? _jsx("span", { dangerouslySetInnerHTML: { __html: content } }) : children;
|
|
9
|
+
const external = !!target || resolvedHref.startsWith('http');
|
|
10
|
+
if (external) {
|
|
11
|
+
return (_jsx("a", { href: resolvedHref, target: target, rel: rel, "data-wr-id": id, "data-wr-type": "link", ...props, children: inner }));
|
|
12
|
+
}
|
|
13
|
+
return (_jsx(Link, { to: resolvedHref, "data-wr-id": id, "data-wr-type": "link", ...props, children: inner }));
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=WrLink.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WrLink.js","sourceRoot":"","sources":["../src/WrLink.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,IAAI,EAAE,MAAM,cAAc,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAW5C,MAAM,UAAU,MAAM,CAAC,EAAE,EAAE,EAAE,IAAI,GAAG,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,KAAK,EAAe;IACnF,MAAM,MAAM,GAAG,SAAS,CAAC,EAAE,CAA6B,CAAC;IACzD,MAAM,YAAY,GAAG,MAAM,EAAE,IAAI,IAAI,IAAI,IAAI,GAAG,CAAC;IACjD,MAAM,OAAO,GAAG,MAAM,EAAE,OAAO,CAAC;IAEhC,MAAM,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,eAAM,uBAAuB,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,GAAI,CAAC,CAAC,CAAC,QAAQ,CAAC;IAE1F,MAAM,QAAQ,GAAG,CAAC,CAAC,MAAM,IAAI,YAAY,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;IAC7D,IAAI,QAAQ,EAAE,CAAC;QACX,OAAO,CACH,YAAG,IAAI,EAAE,YAAY,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,gBAAc,EAAE,kBAAe,MAAM,KAAK,KAAK,YACzF,KAAK,GACN,CACP,CAAC;IACN,CAAC;IACD,OAAO,CACH,KAAC,IAAI,IAAC,EAAE,EAAE,YAAY,gBAAc,EAAE,kBAAe,MAAM,KAAK,KAAK,YAChE,KAAK,GACH,CACV,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { WrPageConfig, WrElementConfig } from './types.js';
|
|
3
|
+
export declare function WrPageProvider({ config, children }: {
|
|
4
|
+
config: WrPageConfig;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}): React.JSX.Element;
|
|
7
|
+
export declare function useWrPage(id: string): WrElementConfig | undefined;
|
|
8
|
+
//# sourceMappingURL=WrPageContext.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WrPageContext.d.ts","sourceRoot":"","sources":["../src/WrPageContext.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AACzD,OAAO,KAAK,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAIhE,wBAAgB,cAAc,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,EAAE;IAAE,MAAM,EAAE,YAAY,CAAC;IAAC,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAA;CAAE,qBAEvG;AAED,wBAAgB,SAAS,CAAC,EAAE,EAAE,MAAM,GAAG,eAAe,GAAG,SAAS,CAGjE"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useContext } from 'react';
|
|
3
|
+
const WrPageContext = createContext(null);
|
|
4
|
+
export function WrPageProvider({ config, children }) {
|
|
5
|
+
return _jsx(WrPageContext.Provider, { value: config, children: children });
|
|
6
|
+
}
|
|
7
|
+
export function useWrPage(id) {
|
|
8
|
+
const ctx = useContext(WrPageContext);
|
|
9
|
+
return ctx?.[id];
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=WrPageContext.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WrPageContext.js","sourceRoot":"","sources":["../src/WrPageContext.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,OAAO,CAAC;AAGzD,MAAM,aAAa,GAAG,aAAa,CAAsB,IAAI,CAAC,CAAC;AAE/D,MAAM,UAAU,cAAc,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAuD;IACpG,OAAO,KAAC,aAAa,CAAC,QAAQ,IAAC,KAAK,EAAE,MAAM,YAAG,QAAQ,GAA0B,CAAC;AACtF,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,EAAU;IAChC,MAAM,GAAG,GAAG,UAAU,CAAC,aAAa,CAAC,CAAC;IACtC,OAAO,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type AllowedTag = 'section' | 'div' | 'article' | 'aside' | 'header' | 'footer' | 'main' | 'nav';
|
|
3
|
+
interface WrSectionOwnProps {
|
|
4
|
+
id: string;
|
|
5
|
+
tag?: AllowedTag;
|
|
6
|
+
children: React.ReactNode;
|
|
7
|
+
}
|
|
8
|
+
type WrSectionProps = WrSectionOwnProps & Omit<React.HTMLAttributes<HTMLElement>, 'id'>;
|
|
9
|
+
export declare function WrSection({ id, tag: Tag, children, ...props }: WrSectionProps): React.ReactElement;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=WrSection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WrSection.d.ts","sourceRoot":"","sources":["../src/WrSection.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,KAAK,UAAU,GAAG,SAAS,GAAG,KAAK,GAAG,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,KAAK,CAAC;AAEjG,UAAU,iBAAiB;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,CAAC,EAAE,UAAU,CAAC;IACjB,QAAQ,EAAE,KAAK,CAAC,SAAS,CAAC;CAC7B;AAED,KAAK,cAAc,GAAG,iBAAiB,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,IAAI,CAAC,CAAC;AAExF,wBAAgB,SAAS,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,GAAe,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAE,EAAE,cAAc,GAAG,KAAK,CAAC,YAAY,CAO9G"}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
export function WrSection({ id, tag: Tag = 'section', children, ...props }) {
|
|
3
|
+
return (_jsx(Tag, { "data-wr-id": id, "data-wr-type": "section", ...props, children: children }));
|
|
4
|
+
}
|
|
5
|
+
//# sourceMappingURL=WrSection.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WrSection.js","sourceRoot":"","sources":["../src/WrSection.tsx"],"names":[],"mappings":";AAYA,MAAM,UAAU,SAAS,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,GAAG,SAAS,EAAE,QAAQ,EAAE,GAAG,KAAK,EAAkB;IAEtF,OAAO,CACH,KAAC,GAAG,kBAAa,EAAE,kBAAe,SAAS,KAAK,KAAK,YAChD,QAAQ,GACP,CACT,CAAC;AACN,CAAC"}
|
package/dist/WrText.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
type AllowedTag = 'div' | 'span' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'p' | 'label';
|
|
3
|
+
interface WrTextOwnProps {
|
|
4
|
+
id: string;
|
|
5
|
+
tag?: AllowedTag;
|
|
6
|
+
html?: string;
|
|
7
|
+
}
|
|
8
|
+
type WrTextProps = WrTextOwnProps & Omit<React.HTMLAttributes<HTMLElement>, 'id' | 'dangerouslySetInnerHTML'>;
|
|
9
|
+
export declare function WrText({ id, tag: Tag, html: fallback, ...props }: WrTextProps): React.ReactElement;
|
|
10
|
+
export {};
|
|
11
|
+
//# sourceMappingURL=WrText.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WrText.d.ts","sourceRoot":"","sources":["../src/WrText.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAI1B,KAAK,UAAU,GAAG,KAAK,GAAG,MAAM,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,GAAG,GAAG,GAAG,OAAO,CAAC;AAE3F,UAAU,cAAc;IACpB,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,CAAC,EAAE,UAAU,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,KAAK,WAAW,GAAG,cAAc,GAAG,IAAI,CAAC,KAAK,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE,IAAI,GAAG,yBAAyB,CAAC,CAAC;AAE9G,wBAAgB,MAAM,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,GAAW,EAAE,IAAI,EAAE,QAAa,EAAE,GAAG,KAAK,EAAE,EAAE,WAAW,GAAG,KAAK,CAAC,YAAY,CAK/G"}
|
package/dist/WrText.js
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useWrPage } from './WrPageContext';
|
|
3
|
+
export function WrText({ id, tag: Tag = 'div', html: fallback = '', ...props }) {
|
|
4
|
+
const config = useWrPage(id);
|
|
5
|
+
return (_jsx(Tag, { "data-wr-id": id, "data-wr-type": "text", dangerouslySetInnerHTML: { __html: config?.content ?? fallback }, ...props }));
|
|
6
|
+
}
|
|
7
|
+
//# sourceMappingURL=WrText.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WrText.js","sourceRoot":"","sources":["../src/WrText.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAa5C,MAAM,UAAU,MAAM,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,GAAG,KAAK,EAAE,IAAI,EAAE,QAAQ,GAAG,EAAE,EAAE,GAAG,KAAK,EAAe;IACvF,MAAM,MAAM,GAAG,SAAS,CAAC,EAAE,CAA6B,CAAC;IACzD,OAAO,CACH,KAAC,GAAG,kBAAa,EAAE,kBAAe,MAAM,EAAC,uBAAuB,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,IAAI,QAAQ,EAAE,KAAM,KAAK,GAAI,CAC3H,CAAC;AACN,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
interface WrVideoOwnProps {
|
|
3
|
+
id: string;
|
|
4
|
+
src?: string;
|
|
5
|
+
}
|
|
6
|
+
type WrVideoProps = WrVideoOwnProps & Omit<React.ComponentPropsWithoutRef<'video'>, 'id'>;
|
|
7
|
+
export declare function WrVideo({ id, src, autoPlay, muted, loop, controls, style, ...props }: WrVideoProps): React.ReactElement;
|
|
8
|
+
export {};
|
|
9
|
+
//# sourceMappingURL=WrVideo.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WrVideo.d.ts","sourceRoot":"","sources":["../src/WrVideo.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA4B,MAAM,OAAO,CAAC;AAKjD,UAAU,eAAe;IACrB,EAAE,EAAE,MAAM,CAAC;IACX,GAAG,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,KAAK,YAAY,GAAG,eAAe,GAAG,IAAI,CAAC,KAAK,CAAC,wBAAwB,CAAC,OAAO,CAAC,EAAE,IAAI,CAAC,CAAC;AAE1F,wBAAgB,OAAO,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,QAAgB,EAAE,KAAa,EAAE,IAAY,EAAE,QAAgB,EAAE,KAAK,EAAE,GAAG,KAAK,EAAE,EAAE,YAAY,GAAG,KAAK,CAAC,YAAY,CAmDvJ"}
|
package/dist/WrVideo.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useRef } from 'react';
|
|
3
|
+
import Hls from 'hls.js';
|
|
4
|
+
import { useWrPage } from './WrPageContext';
|
|
5
|
+
export function WrVideo({ id, src, autoPlay = false, muted = false, loop = false, controls = false, style, ...props }) {
|
|
6
|
+
const config = useWrPage(id);
|
|
7
|
+
const resolvedSrc = config?.src ?? src;
|
|
8
|
+
const videoRef = useRef(null);
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
const video = videoRef.current;
|
|
11
|
+
if (!video || !resolvedSrc)
|
|
12
|
+
return;
|
|
13
|
+
const onEnded = () => {
|
|
14
|
+
if (loop) {
|
|
15
|
+
video.currentTime = 0;
|
|
16
|
+
video.play().catch(() => { });
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
video.addEventListener('ended', onEnded);
|
|
20
|
+
if (Hls.isSupported()) {
|
|
21
|
+
const hls = new Hls({ enableWorker: true });
|
|
22
|
+
hls.loadSource(resolvedSrc);
|
|
23
|
+
hls.attachMedia(video);
|
|
24
|
+
hls.on(Hls.Events.MANIFEST_PARSED, () => {
|
|
25
|
+
if (autoPlay)
|
|
26
|
+
video.play().catch(() => { });
|
|
27
|
+
});
|
|
28
|
+
return () => {
|
|
29
|
+
hls.destroy();
|
|
30
|
+
video.removeEventListener('ended', onEnded);
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
if (video.canPlayType('application/vnd.apple.mpegurl')) {
|
|
34
|
+
video.src = resolvedSrc;
|
|
35
|
+
if (autoPlay)
|
|
36
|
+
video.play().catch(() => { });
|
|
37
|
+
}
|
|
38
|
+
return () => video.removeEventListener('ended', onEnded);
|
|
39
|
+
}, [resolvedSrc, autoPlay, loop]);
|
|
40
|
+
return (_jsx("video", { ref: videoRef, ...props, muted: muted, controls: controls, "data-wr-id": id, "data-wr-type": "video", style: style }));
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=WrVideo.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"WrVideo.js","sourceRoot":"","sources":["../src/WrVideo.tsx"],"names":[],"mappings":";AAAA,OAAc,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,OAAO,CAAC;AACjD,OAAO,GAAG,MAAM,QAAQ,CAAC;AACzB,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAU5C,MAAM,UAAU,OAAO,CAAC,EAAE,EAAE,EAAE,GAAG,EAAE,QAAQ,GAAG,KAAK,EAAE,KAAK,GAAG,KAAK,EAAE,IAAI,GAAG,KAAK,EAAE,QAAQ,GAAG,KAAK,EAAE,KAAK,EAAE,GAAG,KAAK,EAAgB;IAC/H,MAAM,MAAM,GAAG,SAAS,CAAC,EAAE,CAA8B,CAAC;IAC1D,MAAM,WAAW,GAAG,MAAM,EAAE,GAAG,IAAI,GAAG,CAAC;IAEvC,MAAM,QAAQ,GAAG,MAAM,CAAmB,IAAI,CAAC,CAAC;IAEhD,SAAS,CAAC,GAAG,EAAE;QACX,MAAM,KAAK,GAAG,QAAQ,CAAC,OAAO,CAAC;QAC/B,IAAI,CAAC,KAAK,IAAI,CAAC,WAAW;YAAE,OAAO;QAE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AI,CAAC,CAAC,CAAC;IAElC,OAAO,CACH,gBACI,GAAG,EAAE,QAAQ,KACT,KAAK,EACT,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,gBACN,EAAE,kBACD,OAAO,EACpB,KAAK,EAAE,KAAK,GACd,CACL,CAAC;AACN,CAAC"}
|
package/dist/bridge.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridge.d.ts","sourceRoot":"","sources":["../src/bridge.ts"],"names":[],"mappings":"AA0CA,wBAAgB,YAAY,CAAC,YAAY,EAAE,MAAM,QA+FhD"}
|
package/dist/bridge.js
ADDED
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
// packages/core/src/bridge.ts
|
|
2
|
+
function getRect(el) {
|
|
3
|
+
const r = el.getBoundingClientRect();
|
|
4
|
+
return {
|
|
5
|
+
top: r.top + window.scrollY,
|
|
6
|
+
left: r.left + window.scrollX,
|
|
7
|
+
width: r.width,
|
|
8
|
+
height: r.height,
|
|
9
|
+
};
|
|
10
|
+
}
|
|
11
|
+
function parseEl(el) {
|
|
12
|
+
return {
|
|
13
|
+
type: el.getAttribute("data-wr-type") ?? "unknown",
|
|
14
|
+
id: el.getAttribute("data-wr-id"),
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
function post(editorOrigin, data) {
|
|
18
|
+
window.parent.postMessage(data, editorOrigin);
|
|
19
|
+
}
|
|
20
|
+
function scan(editorOrigin) {
|
|
21
|
+
const elements = Array.from(document.querySelectorAll("[data-wr-id]")).map(parseEl);
|
|
22
|
+
post(editorOrigin, { type: "wr:scan", elements });
|
|
23
|
+
}
|
|
24
|
+
export function initWrBridge(editorOrigin) {
|
|
25
|
+
if (window === window.parent)
|
|
26
|
+
return; // non è in un iframe
|
|
27
|
+
function onClick(e) {
|
|
28
|
+
const el = e.target.closest("[data-wr-id]");
|
|
29
|
+
if (!el)
|
|
30
|
+
return;
|
|
31
|
+
e.preventDefault();
|
|
32
|
+
post(editorOrigin, {
|
|
33
|
+
type: "wr:select",
|
|
34
|
+
element: parseEl(el),
|
|
35
|
+
rect: getRect(el),
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
function onMouseOver(e) {
|
|
39
|
+
const el = e.target.closest("[data-wr-id]");
|
|
40
|
+
if (!el)
|
|
41
|
+
return;
|
|
42
|
+
post(editorOrigin, {
|
|
43
|
+
type: "wr:hover",
|
|
44
|
+
element: parseEl(el),
|
|
45
|
+
rect: getRect(el),
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
function onMouseLeave() {
|
|
49
|
+
post(editorOrigin, { type: "wr:hover:leave" });
|
|
50
|
+
}
|
|
51
|
+
function onMessage(e) {
|
|
52
|
+
if (e.origin !== editorOrigin)
|
|
53
|
+
return;
|
|
54
|
+
const { type, element } = e.data ?? {};
|
|
55
|
+
if (type === "wr:highlight") {
|
|
56
|
+
document
|
|
57
|
+
.querySelectorAll("[data-wr-highlighted]")
|
|
58
|
+
.forEach((el) => el.removeAttribute("data-wr-highlighted"));
|
|
59
|
+
if (element?.id) {
|
|
60
|
+
const target = document.querySelector(`[data-wr-id="${element.id}"]`);
|
|
61
|
+
if (target) {
|
|
62
|
+
target.setAttribute("data-wr-highlighted", "true");
|
|
63
|
+
post(editorOrigin, {
|
|
64
|
+
type: "wr:select",
|
|
65
|
+
element: parseEl(target),
|
|
66
|
+
rect: getRect(target),
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
if (type === "wr:highlight:clear") {
|
|
72
|
+
document
|
|
73
|
+
.querySelectorAll("[data-wr-highlighted]")
|
|
74
|
+
.forEach((el) => el.removeAttribute("data-wr-highlighted"));
|
|
75
|
+
}
|
|
76
|
+
if (type === "wr:hover:panel" && element?.id) {
|
|
77
|
+
const target = document.querySelector(`[data-wr-id="${element.id}"]`);
|
|
78
|
+
target?.scrollIntoView({ behavior: "smooth", block: "nearest" });
|
|
79
|
+
}
|
|
80
|
+
if (type === "wr:navigate:push" && typeof e.data.pathname === "string") {
|
|
81
|
+
history.pushState({}, "", e.data.pathname);
|
|
82
|
+
sendNav();
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
scan(editorOrigin);
|
|
86
|
+
const observer = new MutationObserver(() => scan(editorOrigin));
|
|
87
|
+
observer.observe(document.body, { childList: true, subtree: true });
|
|
88
|
+
document.addEventListener("click", onClick);
|
|
89
|
+
document.addEventListener("mouseover", onMouseOver);
|
|
90
|
+
document.addEventListener("mouseleave", onMouseLeave);
|
|
91
|
+
window.addEventListener("message", onMessage);
|
|
92
|
+
function sendNav() {
|
|
93
|
+
const pathname = window.location.pathname.replace(/^\/preview/, "") || "/";
|
|
94
|
+
post(editorOrigin, { type: "wr:navigate", pathname });
|
|
95
|
+
}
|
|
96
|
+
// monkey-patch history to catch React Router
|
|
97
|
+
const _push = history.pushState.bind(history);
|
|
98
|
+
const _replace = history.replaceState.bind(history);
|
|
99
|
+
history.pushState = (...args) => {
|
|
100
|
+
_push(...args);
|
|
101
|
+
sendNav();
|
|
102
|
+
};
|
|
103
|
+
history.replaceState = (...args) => {
|
|
104
|
+
_replace(...args);
|
|
105
|
+
sendNav();
|
|
106
|
+
};
|
|
107
|
+
window.addEventListener("popstate", sendNav);
|
|
108
|
+
sendNav();
|
|
109
|
+
}
|
|
110
|
+
//# sourceMappingURL=bridge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bridge.js","sourceRoot":"","sources":["../src/bridge.ts"],"names":[],"mappings":"AAAA,8BAA8B;AAc9B,SAAS,OAAO,CAAC,EAAW;IACxB,MAAM,CAAC,GAAG,EAAE,CAAC,qBAAqB,EAAE,CAAC;IACrC,OAAO;QACH,GAAG,EAAE,CAAC,CAAC,GAAG,GAAG,MAAM,CAAC,OAAO;QAC3B,IAAI,EAAE,CAAC,CAAC,IAAI,GAAG,MAAM,CAAC,OAAO;QAC7B,KAAK,EAAE,CAAC,CAAC,KAAK;QAC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EAAE,aAAa,EAAE,QAAQ,EAAE,CAAC,CAAC;IAC1D,CAAC;IAED,6CAA6C;IAC7C,MAAM,KAAK,GAAG,OAAO,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IAC9C,MAAM,QAAQ,GAAG,OAAO,CAAC,YAAY,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACpD,OAAO,CAAC,SAAS,GAAG,CAAC,GAAG,IAAI,EAAE,EAAE;QAC5B,KAAK,CAAC,GAAG,IAAI,CAAC,CAAC;QACf,OAAO,EAAE,CAAC;IACd,CAAC,CAAC;IACF,OAAO,CAAC,YAAY,GAAG,CAAC,GAAG,IAAI,EAAE,EAAE;QAC/B,QAAQ,CAAC,GAAG,IAAI,CAAC,CAAC;QAClB,OAAO,EAAE,CAAC;IACd,CAAC,CAAC;IAEF,MAAM,CAAC,gBAAgB,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IAC7C,OAAO,EAAE,CAAC;AACd,CAAC"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { initWrBridge } from './bridge';
|
|
2
|
+
export { WrButton } from './WrButton';
|
|
3
|
+
export { WrImage } from './WrImage';
|
|
4
|
+
export { WrLink } from './WrLink';
|
|
5
|
+
export { WrPageProvider, useWrPage } from './WrPageContext';
|
|
6
|
+
export { WrSection } from './WrSection';
|
|
7
|
+
export { WrText } from './WrText';
|
|
8
|
+
export { WrVideo } from './WrVideo';
|
|
9
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { initWrBridge } from './bridge';
|
|
2
|
+
export { WrButton } from './WrButton';
|
|
3
|
+
export { WrImage } from './WrImage';
|
|
4
|
+
export { WrLink } from './WrLink';
|
|
5
|
+
export { WrPageProvider, useWrPage } from './WrPageContext';
|
|
6
|
+
export { WrSection } from './WrSection';
|
|
7
|
+
export { WrText } from './WrText';
|
|
8
|
+
export { WrVideo } from './WrVideo';
|
|
9
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAExC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,cAAc,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AACxC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export type WrFieldType = 'text' | 'richtext' | 'image' | 'video' | 'url' | 'select' | 'boolean';
|
|
2
|
+
export interface WrFieldSchema {
|
|
3
|
+
type: WrFieldType;
|
|
4
|
+
label?: string;
|
|
5
|
+
options?: string[];
|
|
6
|
+
}
|
|
7
|
+
export type WrSectionSchema = Record<string, WrFieldSchema>;
|
|
8
|
+
export interface WrFieldConfig {
|
|
9
|
+
[key: string]: unknown;
|
|
10
|
+
}
|
|
11
|
+
export type WrPageConfig = Record<string, WrFieldConfig>;
|
|
12
|
+
export type WrElementConfig = WrFieldConfig;
|
|
13
|
+
export interface WrTextConfig {
|
|
14
|
+
content: string;
|
|
15
|
+
}
|
|
16
|
+
export interface WrImageConfig {
|
|
17
|
+
src: string;
|
|
18
|
+
alt?: string;
|
|
19
|
+
}
|
|
20
|
+
export interface WrVideoConfig {
|
|
21
|
+
src: string;
|
|
22
|
+
}
|
|
23
|
+
export interface WrLinkConfig {
|
|
24
|
+
content: string;
|
|
25
|
+
href?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface WrButtonConfig {
|
|
28
|
+
content: string;
|
|
29
|
+
}
|
|
30
|
+
export type WrSectionData = Record<string, unknown>;
|
|
31
|
+
export interface WrPageData {
|
|
32
|
+
[sectionId: string]: WrSectionData;
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,UAAU,GAAG,OAAO,GAAG,OAAO,GAAG,KAAK,GAAG,QAAQ,GAAG,SAAS,CAAC;AAEjG,MAAM,WAAW,aAAa;IAC1B,IAAI,EAAE,WAAW,CAAC;IAClB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACtB;AAED,MAAM,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AAE5D,MAAM,WAAW,aAAa;IAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B;AAED,MAAM,MAAM,YAAY,GAAG,MAAM,CAAC,MAAM,EAAE,aAAa,CAAC,CAAC;AAEzD,MAAM,MAAM,eAAe,GAAG,aAAa,CAAC;AAG5C,MAAM,WAAW,YAAY;IAAG,OAAO,EAAE,MAAM,CAAC;CAAE;AAClD,MAAM,WAAW,aAAa;IAAG,GAAG,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC;CAAE;AAC7D,MAAM,WAAW,aAAa;IAAG,GAAG,EAAE,MAAM,CAAC;CAAE;AAC/C,MAAM,WAAW,YAAY;IAAG,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,CAAC,EAAE,MAAM,CAAC;CAAE;AACjE,MAAM,WAAW,cAAc;IAAG,OAAO,EAAE,MAAM,CAAC;CAAE;AAGpD,MAAM,MAAM,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACpD,MAAM,WAAW,UAAU;IACvB,CAAC,SAAS,EAAE,MAAM,GAAG,aAAa,CAAC;CACtC"}
|
package/dist/types.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}
|
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@webround/core",
|
|
3
|
+
"version": "0.1.7",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"module": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"types": "./dist/index.d.ts"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"dist"
|
|
16
|
+
],
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "tsc",
|
|
19
|
+
"dev": "tsc --watch"
|
|
20
|
+
},
|
|
21
|
+
"dependencies": {
|
|
22
|
+
"hls.js": "^1.5.0"
|
|
23
|
+
},
|
|
24
|
+
"peerDependencies": {
|
|
25
|
+
"react": ">=19",
|
|
26
|
+
"react-router": ">=8"
|
|
27
|
+
},
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"@types/react": "^19.0.0",
|
|
30
|
+
"react": "^19.0.0",
|
|
31
|
+
"react-router": "^8.0.0",
|
|
32
|
+
"typescript": "^5.5.0"
|
|
33
|
+
}
|
|
34
|
+
}
|