@agnos-ui/react-headless 0.10.0-next.2 → 0.10.0-next.3
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/generated/index.d.ts +2 -1
- package/generated/services/pointerdownPosition.cjs +9 -0
- package/generated/services/pointerdownPosition.d.ts +1 -0
- package/generated/services/pointerdownPosition.js +1 -0
- package/index.cjs +14 -7
- package/index.js +2 -1
- package/package.json +2 -2
- package/slot.cjs +4 -18
- package/slot.d.ts +1 -1
- package/slot.js +4 -18
package/generated/index.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from './services/siblingsInert';
|
|
2
2
|
export * from './services/resizeObserver';
|
|
3
3
|
export * from './services/portal';
|
|
4
|
+
export * from './services/pointerdownPosition';
|
|
4
5
|
export * from './services/navManager';
|
|
5
6
|
export * from './services/matchMedia';
|
|
6
7
|
export * from './services/intersection';
|
|
@@ -22,6 +23,7 @@ export * from './types';
|
|
|
22
23
|
export * from './config';
|
|
23
24
|
export * from './components/tree/index';
|
|
24
25
|
export * from './components/toast/index';
|
|
26
|
+
export * from './components/slider/index';
|
|
25
27
|
export * from './components/select/index';
|
|
26
28
|
export * from './components/rating/index';
|
|
27
29
|
export * from './components/progressbar/index';
|
|
@@ -32,6 +34,5 @@ export * from './components/collapse/index';
|
|
|
32
34
|
export * from './components/carousel/index';
|
|
33
35
|
export * from './components/alert/index';
|
|
34
36
|
export * from './components/accordion/index';
|
|
35
|
-
export * from './components/slider/index';
|
|
36
37
|
export * from './utils/portal';
|
|
37
38
|
export * from './slot';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const pointerdownPosition = require("@agnos-ui/core/services/pointerdownPosition");
|
|
4
|
+
Object.keys(pointerdownPosition).forEach((k) => {
|
|
5
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: () => pointerdownPosition[k]
|
|
8
|
+
});
|
|
9
|
+
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@agnos-ui/core/services/pointerdownPosition';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "@agnos-ui/core/services/pointerdownPosition";
|
package/index.cjs
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const siblingsInert = require("@agnos-ui/core/services/siblingsInert");
|
|
4
4
|
const resizeObserver = require("@agnos-ui/core/services/resizeObserver");
|
|
5
5
|
const portal = require("@agnos-ui/core/services/portal");
|
|
6
|
+
const pointerdownPosition = require("@agnos-ui/core/services/pointerdownPosition");
|
|
6
7
|
const navManager = require("@agnos-ui/core/services/navManager");
|
|
7
8
|
const matchMedia = require("@agnos-ui/core/services/matchMedia");
|
|
8
9
|
const intersection = require("@agnos-ui/core/services/intersection");
|
|
@@ -29,6 +30,7 @@ const config = require("./config.cjs");
|
|
|
29
30
|
const tree = require("@agnos-ui/core/components/tree");
|
|
30
31
|
const toasterProvider = require("./toasterProvider-CYgzar_d.cjs");
|
|
31
32
|
const toast = require("@agnos-ui/core/components/toast");
|
|
33
|
+
const slider = require("@agnos-ui/core/components/slider");
|
|
32
34
|
const select = require("@agnos-ui/core/components/select");
|
|
33
35
|
const rating = require("@agnos-ui/core/components/rating");
|
|
34
36
|
const progressbar = require("@agnos-ui/core/components/progressbar");
|
|
@@ -39,7 +41,6 @@ const collapse$1 = require("@agnos-ui/core/components/collapse");
|
|
|
39
41
|
const carousel = require("@agnos-ui/core/components/carousel");
|
|
40
42
|
const alert = require("@agnos-ui/core/components/alert");
|
|
41
43
|
const accordion = require("@agnos-ui/core/components/accordion");
|
|
42
|
-
const slider = require("@agnos-ui/core/components/slider");
|
|
43
44
|
const portal$1 = require("./portal-B0Q5KLrA.cjs");
|
|
44
45
|
const slot = require("./slot.cjs");
|
|
45
46
|
exports.useWidgetWithConfig = widget.useWidgetWithConfig;
|
|
@@ -78,6 +79,12 @@ Object.keys(portal).forEach((k) => {
|
|
|
78
79
|
get: () => portal[k]
|
|
79
80
|
});
|
|
80
81
|
});
|
|
82
|
+
Object.keys(pointerdownPosition).forEach((k) => {
|
|
83
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
84
|
+
enumerable: true,
|
|
85
|
+
get: () => pointerdownPosition[k]
|
|
86
|
+
});
|
|
87
|
+
});
|
|
81
88
|
Object.keys(navManager).forEach((k) => {
|
|
82
89
|
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
83
90
|
enumerable: true,
|
|
@@ -204,6 +211,12 @@ Object.keys(toast).forEach((k) => {
|
|
|
204
211
|
get: () => toast[k]
|
|
205
212
|
});
|
|
206
213
|
});
|
|
214
|
+
Object.keys(slider).forEach((k) => {
|
|
215
|
+
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
216
|
+
enumerable: true,
|
|
217
|
+
get: () => slider[k]
|
|
218
|
+
});
|
|
219
|
+
});
|
|
207
220
|
Object.keys(select).forEach((k) => {
|
|
208
221
|
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
209
222
|
enumerable: true,
|
|
@@ -264,9 +277,3 @@ Object.keys(accordion).forEach((k) => {
|
|
|
264
277
|
get: () => accordion[k]
|
|
265
278
|
});
|
|
266
279
|
});
|
|
267
|
-
Object.keys(slider).forEach((k) => {
|
|
268
|
-
if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) Object.defineProperty(exports, k, {
|
|
269
|
-
enumerable: true,
|
|
270
|
-
get: () => slider[k]
|
|
271
|
-
});
|
|
272
|
-
});
|
package/index.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
export * from "@agnos-ui/core/services/siblingsInert";
|
|
2
2
|
export * from "@agnos-ui/core/services/resizeObserver";
|
|
3
3
|
export * from "@agnos-ui/core/services/portal";
|
|
4
|
+
export * from "@agnos-ui/core/services/pointerdownPosition";
|
|
4
5
|
export * from "@agnos-ui/core/services/navManager";
|
|
5
6
|
export * from "@agnos-ui/core/services/matchMedia";
|
|
6
7
|
export * from "@agnos-ui/core/services/intersection";
|
|
@@ -27,6 +28,7 @@ import { WidgetsConfigContext, WidgetsDefaultConfig, useWidget, useWidgetContext
|
|
|
27
28
|
export * from "@agnos-ui/core/components/tree";
|
|
28
29
|
import { T, u as u4, a as a3 } from "./toasterProvider-CzmXu8rV.js";
|
|
29
30
|
export * from "@agnos-ui/core/components/toast";
|
|
31
|
+
export * from "@agnos-ui/core/components/slider";
|
|
30
32
|
export * from "@agnos-ui/core/components/select";
|
|
31
33
|
export * from "@agnos-ui/core/components/rating";
|
|
32
34
|
export * from "@agnos-ui/core/components/progressbar";
|
|
@@ -37,7 +39,6 @@ export * from "@agnos-ui/core/components/collapse";
|
|
|
37
39
|
export * from "@agnos-ui/core/components/carousel";
|
|
38
40
|
export * from "@agnos-ui/core/components/alert";
|
|
39
41
|
export * from "@agnos-ui/core/components/accordion";
|
|
40
|
-
export * from "@agnos-ui/core/components/slider";
|
|
41
42
|
import { P } from "./portal-CX8X69NK.js";
|
|
42
43
|
import { Slot } from "./slot.js";
|
|
43
44
|
export {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agnos-ui/react-headless",
|
|
3
3
|
"description": "Headless component library for React.",
|
|
4
|
-
"version": "0.10.0-next.
|
|
4
|
+
"version": "0.10.0-next.3",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.cjs",
|
|
7
7
|
"module": "./index.js",
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@agnos-ui/core": "0.10.0-next.
|
|
52
|
+
"@agnos-ui/core": "0.10.0-next.3"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"@amadeus-it-group/tansu": "^2.0.0",
|
package/slot.cjs
CHANGED
|
@@ -2,26 +2,12 @@
|
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const jsxRuntime = require("react/jsx-runtime");
|
|
4
4
|
const react = require("react");
|
|
5
|
-
const slotWrapperCache = /* @__PURE__ */ new WeakMap();
|
|
6
|
-
const slotWrapperFactory = (slotContent) => {
|
|
7
|
-
const SlotWrapper = (props) => /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: slotContent(props) });
|
|
8
|
-
return SlotWrapper;
|
|
9
|
-
};
|
|
10
|
-
const slotWrapper = (slotContent) => {
|
|
11
|
-
let res = slotWrapperCache.get(slotContent);
|
|
12
|
-
if (!res) {
|
|
13
|
-
res = slotWrapperFactory(slotContent);
|
|
14
|
-
slotWrapperCache.set(slotContent, res);
|
|
15
|
-
}
|
|
16
|
-
return res;
|
|
17
|
-
};
|
|
18
5
|
const isReactComponent = (item) => item.prototype instanceof react.Component;
|
|
19
|
-
const Slot = ({ slotContent, props }) => {
|
|
20
|
-
const isFunction = typeof
|
|
6
|
+
const Slot = ({ slotContent: SlotContent, props }) => {
|
|
7
|
+
const isFunction = typeof SlotContent === "function";
|
|
21
8
|
if (isFunction) {
|
|
22
|
-
|
|
23
|
-
return /* @__PURE__ */ jsxRuntime.jsx(SlotComponent, { ...props });
|
|
9
|
+
return isReactComponent(SlotContent) ? /* @__PURE__ */ jsxRuntime.jsx(SlotContent, { ...props }) : /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: SlotContent(props) });
|
|
24
10
|
}
|
|
25
|
-
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children:
|
|
11
|
+
return /* @__PURE__ */ jsxRuntime.jsx(jsxRuntime.Fragment, { children: SlotContent });
|
|
26
12
|
};
|
|
27
13
|
exports.Slot = Slot;
|
package/slot.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ import type { SlotContent } from './types';
|
|
|
9
9
|
* @param parameter.props - the react component props
|
|
10
10
|
* @returns the slot component
|
|
11
11
|
*/
|
|
12
|
-
export declare const Slot: <Props extends object>({ slotContent, props }: {
|
|
12
|
+
export declare const Slot: <Props extends object>({ slotContent: SlotContent, props }: {
|
|
13
13
|
slotContent: SlotContent<Props>;
|
|
14
14
|
props: Props;
|
|
15
15
|
}) => import("react/jsx-runtime").JSX.Element;
|
package/slot.js
CHANGED
|
@@ -1,26 +1,12 @@
|
|
|
1
1
|
import { jsx, Fragment } from "react/jsx-runtime";
|
|
2
2
|
import { Component } from "react";
|
|
3
|
-
const slotWrapperCache = /* @__PURE__ */ new WeakMap();
|
|
4
|
-
const slotWrapperFactory = (slotContent) => {
|
|
5
|
-
const SlotWrapper = (props) => /* @__PURE__ */ jsx(Fragment, { children: slotContent(props) });
|
|
6
|
-
return SlotWrapper;
|
|
7
|
-
};
|
|
8
|
-
const slotWrapper = (slotContent) => {
|
|
9
|
-
let res = slotWrapperCache.get(slotContent);
|
|
10
|
-
if (!res) {
|
|
11
|
-
res = slotWrapperFactory(slotContent);
|
|
12
|
-
slotWrapperCache.set(slotContent, res);
|
|
13
|
-
}
|
|
14
|
-
return res;
|
|
15
|
-
};
|
|
16
3
|
const isReactComponent = (item) => item.prototype instanceof Component;
|
|
17
|
-
const Slot = ({ slotContent, props }) => {
|
|
18
|
-
const isFunction = typeof
|
|
4
|
+
const Slot = ({ slotContent: SlotContent, props }) => {
|
|
5
|
+
const isFunction = typeof SlotContent === "function";
|
|
19
6
|
if (isFunction) {
|
|
20
|
-
|
|
21
|
-
return /* @__PURE__ */ jsx(SlotComponent, { ...props });
|
|
7
|
+
return isReactComponent(SlotContent) ? /* @__PURE__ */ jsx(SlotContent, { ...props }) : /* @__PURE__ */ jsx(Fragment, { children: SlotContent(props) });
|
|
22
8
|
}
|
|
23
|
-
return /* @__PURE__ */ jsx(Fragment, { children:
|
|
9
|
+
return /* @__PURE__ */ jsx(Fragment, { children: SlotContent });
|
|
24
10
|
};
|
|
25
11
|
export {
|
|
26
12
|
Slot
|