@mittwald/flow-remote-react-components 1.2.0-next.48 → 1.2.0-next.49
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/js/auto-generated/DialogTrigger.mjs +2 -1
- package/dist/js/auto-generated/DialogTrigger.mjs.map +1 -1
- package/dist/js/components/createFlowRemoteComponent.mjs +5 -2
- package/dist/js/components/createFlowRemoteComponent.mjs.map +1 -1
- package/dist/js/version.mjs +1 -1
- package/dist/types/components/createFlowRemoteComponent.d.ts +4 -1
- package/package.json +10 -10
|
@@ -6,7 +6,8 @@ import { RemoteDialogTriggerElement } from "@mittwald/flow-remote-elements";
|
|
|
6
6
|
//#region src/auto-generated/DialogTrigger.ts
|
|
7
7
|
var DialogTrigger = createFlowRemoteComponent("flr-dialog-trigger", "DialogTrigger", RemoteDialogTriggerElement, {
|
|
8
8
|
slotProps: { wrapper: "flr-slot-root-wrapper" },
|
|
9
|
-
eventProps: { onOpenChange: { event: "openChange" } }
|
|
9
|
+
eventProps: { onOpenChange: { event: "openChange" } },
|
|
10
|
+
type: "provider"
|
|
10
11
|
});
|
|
11
12
|
//#endregion
|
|
12
13
|
export { DialogTrigger };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DialogTrigger.mjs","names":[],"sources":["../../../src/auto-generated/DialogTrigger.ts"],"sourcesContent":["/* prettier-ignore */\n/* This file is auto-generated with the remote-components-generator */\n\"use client\";\nimport createFlowRemoteComponent from \"@/components/createFlowRemoteComponent\";\nimport { RemoteDialogTriggerElement } from \"@mittwald/flow-remote-elements\";\nexport { type RemoteDialogTriggerElement } from \"@mittwald/flow-remote-elements\";\n\nexport const DialogTrigger = createFlowRemoteComponent(\n \"flr-dialog-trigger\",\n \"DialogTrigger\",\n RemoteDialogTriggerElement,\n {\n slotProps: {\n wrapper: \"flr-slot-root-wrapper\",\n },\n eventProps: {\n onOpenChange: { event: \"openChange\" } as never,\n },\n },\n);\n"],"mappings":";;;;;;AAOA,IAAa,gBAAgB,0BAC3B,sBACA,iBACA,4BACA;CACE,WAAW,EACT,SAAS,wBACX;CACA,YAAY,EACV,cAAc,EAAE,OAAO,aAAa,EACtC;
|
|
1
|
+
{"version":3,"file":"DialogTrigger.mjs","names":[],"sources":["../../../src/auto-generated/DialogTrigger.ts"],"sourcesContent":["/* prettier-ignore */\n/* This file is auto-generated with the remote-components-generator */\n\"use client\";\nimport createFlowRemoteComponent from \"@/components/createFlowRemoteComponent\";\nimport { RemoteDialogTriggerElement } from \"@mittwald/flow-remote-elements\";\nexport { type RemoteDialogTriggerElement } from \"@mittwald/flow-remote-elements\";\n\nexport const DialogTrigger = createFlowRemoteComponent(\n \"flr-dialog-trigger\",\n \"DialogTrigger\",\n RemoteDialogTriggerElement,\n {\n slotProps: {\n wrapper: \"flr-slot-root-wrapper\",\n },\n eventProps: {\n onOpenChange: { event: \"openChange\" } as never,\n },\n type: \"provider\",\n },\n);\n"],"mappings":";;;;;;AAOA,IAAa,gBAAgB,0BAC3B,sBACA,iBACA,4BACA;CACE,WAAW,EACT,SAAS,wBACX;CACA,YAAY,EACV,cAAc,EAAE,OAAO,aAAa,EACtC;CACA,MAAM;AACR,CACF"}
|
|
@@ -5,14 +5,17 @@ import { ViewCompositionReset, flowComponent, isFlowComponentName, useReportComp
|
|
|
5
5
|
import { createElement } from "react";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
7
|
//#region src/components/createFlowRemoteComponent.tsx
|
|
8
|
-
function createFlowRemoteComponent(tag, flowComponentTag, Element = customElements.get(tag), { slotProps = true, eventProps = {} } = {}) {
|
|
8
|
+
function createFlowRemoteComponent(tag, flowComponentTag, Element = customElements.get(tag), { slotProps = true, eventProps = {}, type } = {}) {
|
|
9
9
|
const element = createRemoteComponent(tag, Element, {
|
|
10
10
|
slotProps,
|
|
11
11
|
eventProps
|
|
12
12
|
});
|
|
13
13
|
if (isFlowComponentName(flowComponentTag)) return flowComponent(flowComponentTag, (p) => {
|
|
14
14
|
return createElement(element, p, p.children);
|
|
15
|
-
}, {
|
|
15
|
+
}, {
|
|
16
|
+
isRemoteComponent: true,
|
|
17
|
+
type
|
|
18
|
+
});
|
|
16
19
|
const RemoteComponent = (props) => {
|
|
17
20
|
const isViewComposition = useReportComponentUsage(flowComponentTag);
|
|
18
21
|
const remoteElement = createElement(element, props, props.children);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createFlowRemoteComponent.mjs","names":[],"sources":["../../../src/components/createFlowRemoteComponent.tsx"],"sourcesContent":["import type {\n RemoteComponentOptions,\n RemoteComponentTypeFromElementConstructor,\n} from \"@mittwald/remote-dom-react\";\nimport {\n flowComponent,\n isFlowComponentName,\n useReportComponentUsage,\n ViewCompositionReset,\n} from \"@mittwald/flow-react-components/internal\";\nimport type {\n RemoteElement,\n RemoteElementConstructor,\n} from \"@mittwald/flow-remote-core\";\nimport { createElement, type FC } from \"react\";\nimport { createRemoteComponent } from \"@/lib/createRemoteComponent\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AnyRecord = Record<string, any>;\n\nexport function createFlowRemoteComponent<\n Tag extends keyof HTMLElementTagNameMap,\n ElementConstructor extends RemoteElementConstructor<\n AnyRecord,\n AnyRecord,\n AnyRecord,\n AnyRecord\n > = HTMLElementTagNameMap[Tag] extends RemoteElement<\n infer Properties,\n infer Methods,\n infer Slots,\n infer EventListeners\n >\n ? RemoteElementConstructor<Properties, Methods, Slots, EventListeners>\n : never,\n Props extends AnyRecord = AnyRecord,\n>(\n tag: Tag,\n flowComponentTag: string,\n Element: ElementConstructor | undefined = customElements.get(tag) as never,\n {\n slotProps = true,\n eventProps = {} as never,\n }: RemoteComponentOptions<ElementConstructor, Props> = {},\n): RemoteComponentTypeFromElementConstructor<ElementConstructor> {\n const element = createRemoteComponent(tag, Element, {\n slotProps,\n eventProps,\n });\n\n if (isFlowComponentName(flowComponentTag)) {\n return flowComponent(\n flowComponentTag,\n (p) => {\n return createElement(element, p as never, p.children);\n },\n {\n isRemoteComponent: true,\n },\n ) as never;\n }\n\n const RemoteComponent: FC<AnyRecord> = (props) => {\n const isViewComposition = useReportComponentUsage(flowComponentTag);\n const remoteElement = createElement(\n element,\n props as never,\n props.children,\n );\n\n return isViewComposition ? (\n <ViewCompositionReset>{remoteElement}</ViewCompositionReset>\n ) : (\n remoteElement\n );\n };\n\n RemoteComponent.displayName = `FlowRemoteComponent(${flowComponentTag})`;\n\n return RemoteComponent as never;\n}\n\nexport default createFlowRemoteComponent;\n"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"createFlowRemoteComponent.mjs","names":[],"sources":["../../../src/components/createFlowRemoteComponent.tsx"],"sourcesContent":["import type {\n RemoteComponentOptions,\n RemoteComponentTypeFromElementConstructor,\n} from \"@mittwald/remote-dom-react\";\nimport type { FlowComponentProvisionType } from \"@mittwald/flow-react-components/internal\";\nimport {\n flowComponent,\n isFlowComponentName,\n useReportComponentUsage,\n ViewCompositionReset,\n} from \"@mittwald/flow-react-components/internal\";\nimport type {\n RemoteElement,\n RemoteElementConstructor,\n} from \"@mittwald/flow-remote-core\";\nimport { createElement, type FC } from \"react\";\nimport { createRemoteComponent } from \"@/lib/createRemoteComponent\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype AnyRecord = Record<string, any>;\n\nexport function createFlowRemoteComponent<\n Tag extends keyof HTMLElementTagNameMap,\n ElementConstructor extends RemoteElementConstructor<\n AnyRecord,\n AnyRecord,\n AnyRecord,\n AnyRecord\n > = HTMLElementTagNameMap[Tag] extends RemoteElement<\n infer Properties,\n infer Methods,\n infer Slots,\n infer EventListeners\n >\n ? RemoteElementConstructor<Properties, Methods, Slots, EventListeners>\n : never,\n Props extends AnyRecord = AnyRecord,\n>(\n tag: Tag,\n flowComponentTag: string,\n Element: ElementConstructor | undefined = customElements.get(tag) as never,\n {\n slotProps = true,\n eventProps = {} as never,\n type,\n }: RemoteComponentOptions<ElementConstructor, Props> & {\n /*\n * The provision type of the component this stands in for. It has to travel\n * with the generated component, because `flowComponent` defaults to `\"ui\"`\n * — which wraps the element in a `ClearPropsContext` and cuts every props\n * context that a surrounding provider set. A trigger whose local\n * counterpart is not `@flr-generate` renders inside the remote tree\n * (`ModalTrigger` → `OverlayTrigger` → this element), so clearing there\n * drops the `onPress` its own trigger just supplied.\n */\n type?: FlowComponentProvisionType;\n } = {},\n): RemoteComponentTypeFromElementConstructor<ElementConstructor> {\n const element = createRemoteComponent(tag, Element, {\n slotProps,\n eventProps,\n });\n\n if (isFlowComponentName(flowComponentTag)) {\n return flowComponent(\n flowComponentTag,\n (p) => {\n return createElement(element, p as never, p.children);\n },\n {\n isRemoteComponent: true,\n type,\n },\n ) as never;\n }\n\n const RemoteComponent: FC<AnyRecord> = (props) => {\n const isViewComposition = useReportComponentUsage(flowComponentTag);\n const remoteElement = createElement(\n element,\n props as never,\n props.children,\n );\n\n return isViewComposition ? (\n <ViewCompositionReset>{remoteElement}</ViewCompositionReset>\n ) : (\n remoteElement\n );\n };\n\n RemoteComponent.displayName = `FlowRemoteComponent(${flowComponentTag})`;\n\n return RemoteComponent as never;\n}\n\nexport default createFlowRemoteComponent;\n"],"mappings":";;;;;;;AAqBA,SAAgB,0BAiBd,KACA,kBACA,UAA0C,eAAe,IAAI,GAAG,GAChE,EACE,YAAY,MACZ,aAAa,CAAC,GACd,SAYE,CAAC,GAC0D;CAC/D,MAAM,UAAU,sBAAsB,KAAK,SAAS;EAClD;EACA;CACF,CAAC;CAED,IAAI,oBAAoB,gBAAgB,GACtC,OAAO,cACL,mBACC,MAAM;EACL,OAAO,cAAc,SAAS,GAAY,EAAE,QAAQ;CACtD,GACA;EACE,mBAAmB;EACnB;CACF,CACF;CAGF,MAAM,mBAAkC,UAAU;EAChD,MAAM,oBAAoB,wBAAwB,gBAAgB;EAClE,MAAM,gBAAgB,cACpB,SACA,OACA,MAAM,QACR;EAEA,OAAO,oBACL,oBAAC,sBAAD,EAAA,UAAuB,cAAoC,CAAA,IAE3D;CAEJ;CAEA,gBAAgB,cAAc,uBAAuB,iBAAiB;CAEtE,OAAO;AACT"}
|
package/dist/js/version.mjs
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import { Version } from "@mittwald/flow-remote-core";
|
|
4
4
|
//#region src/version.ts
|
|
5
5
|
var communicationVersion = Version.v5;
|
|
6
|
-
var packageVersion = "1.2.0-next.
|
|
6
|
+
var packageVersion = "1.2.0-next.49";
|
|
7
7
|
var version = communicationVersion;
|
|
8
8
|
//#endregion
|
|
9
9
|
export { communicationVersion, packageVersion, version };
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { RemoteComponentOptions, RemoteComponentTypeFromElementConstructor } from '@mittwald/remote-dom-react';
|
|
2
|
+
import { FlowComponentProvisionType } from '@mittwald/flow-react-components/internal';
|
|
2
3
|
import { RemoteElement, RemoteElementConstructor } from '@mittwald/flow-remote-core';
|
|
3
4
|
type AnyRecord = Record<string, any>;
|
|
4
|
-
export declare function createFlowRemoteComponent<Tag extends keyof HTMLElementTagNameMap, ElementConstructor extends RemoteElementConstructor<AnyRecord, AnyRecord, AnyRecord, AnyRecord> = HTMLElementTagNameMap[Tag] extends RemoteElement<infer Properties, infer Methods, infer Slots, infer EventListeners> ? RemoteElementConstructor<Properties, Methods, Slots, EventListeners> : never, Props extends AnyRecord = AnyRecord>(tag: Tag, flowComponentTag: string, Element?: ElementConstructor | undefined, { slotProps, eventProps, }?: RemoteComponentOptions<ElementConstructor, Props>
|
|
5
|
+
export declare function createFlowRemoteComponent<Tag extends keyof HTMLElementTagNameMap, ElementConstructor extends RemoteElementConstructor<AnyRecord, AnyRecord, AnyRecord, AnyRecord> = HTMLElementTagNameMap[Tag] extends RemoteElement<infer Properties, infer Methods, infer Slots, infer EventListeners> ? RemoteElementConstructor<Properties, Methods, Slots, EventListeners> : never, Props extends AnyRecord = AnyRecord>(tag: Tag, flowComponentTag: string, Element?: ElementConstructor | undefined, { slotProps, eventProps, type, }?: RemoteComponentOptions<ElementConstructor, Props> & {
|
|
6
|
+
type?: FlowComponentProvisionType;
|
|
7
|
+
}): RemoteComponentTypeFromElementConstructor<ElementConstructor>;
|
|
5
8
|
export default createFlowRemoteComponent;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mittwald/flow-remote-react-components",
|
|
3
|
-
"version": "1.2.0-next.
|
|
3
|
+
"version": "1.2.0-next.49",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "React components that can be used in a remote environment",
|
|
6
6
|
"homepage": "https://flow.mittwald.de",
|
|
@@ -52,19 +52,19 @@
|
|
|
52
52
|
"test:visual:update": "vitest run --project=visual --browser.headless --update"
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
|
-
"@mittwald/flow-react-components": "1.2.0-next.
|
|
56
|
-
"@mittwald/flow-remote-core": "1.2.0-next.
|
|
57
|
-
"@mittwald/flow-remote-elements": "1.2.0-next.
|
|
55
|
+
"@mittwald/flow-react-components": "1.2.0-next.49",
|
|
56
|
+
"@mittwald/flow-remote-core": "1.2.0-next.49",
|
|
57
|
+
"@mittwald/flow-remote-elements": "1.2.0-next.49",
|
|
58
58
|
"@mittwald/remote-dom-react": "1.2.2-mittwald.10",
|
|
59
59
|
"@types/react": "^19.2",
|
|
60
60
|
"react-error-boundary": "^6.1.3"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|
|
63
63
|
"@internationalized/date": "^3.12.3",
|
|
64
|
-
"@mittwald/ext-bridge": "1.2.0-next.
|
|
65
|
-
"@mittwald/flow-core": "1.2.0-next.
|
|
66
|
-
"@mittwald/flow-remote-react-renderer": "1.2.0-next.
|
|
67
|
-
"@mittwald/typescript-config": "1.2.0-next.
|
|
64
|
+
"@mittwald/ext-bridge": "1.2.0-next.49",
|
|
65
|
+
"@mittwald/flow-core": "1.2.0-next.49",
|
|
66
|
+
"@mittwald/flow-remote-react-renderer": "1.2.0-next.49",
|
|
67
|
+
"@mittwald/typescript-config": "1.2.0-next.49",
|
|
68
68
|
"@quilted/threads": "^3.3.1",
|
|
69
69
|
"@tabler/icons-react": "^3.44.0",
|
|
70
70
|
"@types/node": "^25.9.3",
|
|
@@ -90,7 +90,7 @@
|
|
|
90
90
|
},
|
|
91
91
|
"peerDependencies": {
|
|
92
92
|
"@internationalized/date": "^3.12.2",
|
|
93
|
-
"@mittwald/ext-bridge": "1.2.0-next.
|
|
93
|
+
"@mittwald/ext-bridge": "1.2.0-next.49",
|
|
94
94
|
"react": "^19.2.0",
|
|
95
95
|
"react-hook-form": "^7.65.0"
|
|
96
96
|
},
|
|
@@ -105,5 +105,5 @@
|
|
|
105
105
|
"optional": true
|
|
106
106
|
}
|
|
107
107
|
},
|
|
108
|
-
"gitHead": "
|
|
108
|
+
"gitHead": "1a48b08178b38e311205f4656fe553e6746d45f0"
|
|
109
109
|
}
|