@uipath/apollo-wind 2.82.0 → 2.84.0
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/components/icons/Lock.cjs +67 -0
- package/dist/components/icons/Lock.d.ts +10 -0
- package/dist/components/icons/Lock.js +20 -0
- package/dist/components/icons/Unlock.cjs +65 -0
- package/dist/components/icons/Unlock.d.ts +10 -0
- package/dist/components/icons/Unlock.js +18 -0
- package/dist/components/ui/index.cjs +24 -24
- package/dist/components/ui/quick-form-field/components/lock-toggle-button.cjs +3 -6
- package/dist/components/ui/quick-form-field/components/lock-toggle-button.js +3 -6
- package/dist/styles.css +15 -13
- package/dist/tailwind.css +28 -18
- package/package.json +13 -4
- package/postcss-scope-preflight.d.ts +23 -0
- package/postcss-scope-preflight.js +218 -0
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.n = (module)=>{
|
|
5
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
6
|
+
__webpack_require__.d(getter, {
|
|
7
|
+
a: getter
|
|
8
|
+
});
|
|
9
|
+
return getter;
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
14
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: definition[key]
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
})();
|
|
20
|
+
(()=>{
|
|
21
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
22
|
+
})();
|
|
23
|
+
(()=>{
|
|
24
|
+
__webpack_require__.r = (exports1)=>{
|
|
25
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
26
|
+
value: 'Module'
|
|
27
|
+
});
|
|
28
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
29
|
+
value: true
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
})();
|
|
33
|
+
var __webpack_exports__ = {};
|
|
34
|
+
__webpack_require__.r(__webpack_exports__);
|
|
35
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
36
|
+
Lock: ()=>Lock,
|
|
37
|
+
default: ()=>icons_Lock
|
|
38
|
+
});
|
|
39
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
40
|
+
const external_react_namespaceObject = require("react");
|
|
41
|
+
var external_react_default = /*#__PURE__*/ __webpack_require__.n(external_react_namespaceObject);
|
|
42
|
+
const Lock = /*#__PURE__*/ external_react_default().forwardRef(({ size, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("svg", {
|
|
43
|
+
viewBox: "0 0 24 24",
|
|
44
|
+
fill: "none",
|
|
45
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
46
|
+
ref: ref,
|
|
47
|
+
...props,
|
|
48
|
+
width: size ?? 24,
|
|
49
|
+
height: size ?? 24,
|
|
50
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("path", {
|
|
51
|
+
fillRule: "evenodd",
|
|
52
|
+
clipRule: "evenodd",
|
|
53
|
+
d: "M17 8.5H18C19.1 8.5 20 9.4 20 10.5V20.5C20 21.6 19.1 22.5 18 22.5H6C4.9 22.5 4 21.6 4 20.5V10.5C4 9.4 4.9 8.5 6 8.5H7V6.5C7 3.74 9.24 1.5 12 1.5C14.76 1.5 17 3.74 17 6.5V8.5ZM12 3.5C10.34 3.5 9 4.84 9 6.5V8.5H15V6.5C15 4.84 13.66 3.5 12 3.5ZM6 20.5V10.5H18V20.5H6ZM14 15.5C14 16.6 13.1 17.5 12 17.5C10.9 17.5 10 16.6 10 15.5C10 14.4 10.9 13.5 12 13.5C13.1 13.5 14 14.4 14 15.5Z",
|
|
54
|
+
fill: "currentColor"
|
|
55
|
+
})
|
|
56
|
+
}));
|
|
57
|
+
Lock.displayName = 'Lock';
|
|
58
|
+
const icons_Lock = Lock;
|
|
59
|
+
exports.Lock = __webpack_exports__.Lock;
|
|
60
|
+
exports["default"] = __webpack_exports__["default"];
|
|
61
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
62
|
+
"Lock",
|
|
63
|
+
"default"
|
|
64
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
65
|
+
Object.defineProperty(exports, '__esModule', {
|
|
66
|
+
value: true
|
|
67
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface LockProps extends Omit<React.SVGProps<SVGSVGElement>, 'width' | 'height'> {
|
|
3
|
+
/**
|
|
4
|
+
* Size to apply to both width and height.
|
|
5
|
+
* @default 24
|
|
6
|
+
*/
|
|
7
|
+
size?: string | number;
|
|
8
|
+
}
|
|
9
|
+
export declare const Lock: React.ForwardRefExoticComponent<Omit<LockProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
10
|
+
export default Lock;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import react from "react";
|
|
3
|
+
const Lock = /*#__PURE__*/ react.forwardRef(({ size, ...props }, ref)=>/*#__PURE__*/ jsx("svg", {
|
|
4
|
+
viewBox: "0 0 24 24",
|
|
5
|
+
fill: "none",
|
|
6
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7
|
+
ref: ref,
|
|
8
|
+
...props,
|
|
9
|
+
width: size ?? 24,
|
|
10
|
+
height: size ?? 24,
|
|
11
|
+
children: /*#__PURE__*/ jsx("path", {
|
|
12
|
+
fillRule: "evenodd",
|
|
13
|
+
clipRule: "evenodd",
|
|
14
|
+
d: "M17 8.5H18C19.1 8.5 20 9.4 20 10.5V20.5C20 21.6 19.1 22.5 18 22.5H6C4.9 22.5 4 21.6 4 20.5V10.5C4 9.4 4.9 8.5 6 8.5H7V6.5C7 3.74 9.24 1.5 12 1.5C14.76 1.5 17 3.74 17 6.5V8.5ZM12 3.5C10.34 3.5 9 4.84 9 6.5V8.5H15V6.5C15 4.84 13.66 3.5 12 3.5ZM6 20.5V10.5H18V20.5H6ZM14 15.5C14 16.6 13.1 17.5 12 17.5C10.9 17.5 10 16.6 10 15.5C10 14.4 10.9 13.5 12 13.5C13.1 13.5 14 14.4 14 15.5Z",
|
|
15
|
+
fill: "currentColor"
|
|
16
|
+
})
|
|
17
|
+
}));
|
|
18
|
+
Lock.displayName = 'Lock';
|
|
19
|
+
const icons_Lock = Lock;
|
|
20
|
+
export { Lock, icons_Lock as default };
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __webpack_require__ = {};
|
|
3
|
+
(()=>{
|
|
4
|
+
__webpack_require__.n = (module)=>{
|
|
5
|
+
var getter = module && module.__esModule ? ()=>module['default'] : ()=>module;
|
|
6
|
+
__webpack_require__.d(getter, {
|
|
7
|
+
a: getter
|
|
8
|
+
});
|
|
9
|
+
return getter;
|
|
10
|
+
};
|
|
11
|
+
})();
|
|
12
|
+
(()=>{
|
|
13
|
+
__webpack_require__.d = (exports1, definition)=>{
|
|
14
|
+
for(var key in definition)if (__webpack_require__.o(definition, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: definition[key]
|
|
17
|
+
});
|
|
18
|
+
};
|
|
19
|
+
})();
|
|
20
|
+
(()=>{
|
|
21
|
+
__webpack_require__.o = (obj, prop)=>Object.prototype.hasOwnProperty.call(obj, prop);
|
|
22
|
+
})();
|
|
23
|
+
(()=>{
|
|
24
|
+
__webpack_require__.r = (exports1)=>{
|
|
25
|
+
if ("u" > typeof Symbol && Symbol.toStringTag) Object.defineProperty(exports1, Symbol.toStringTag, {
|
|
26
|
+
value: 'Module'
|
|
27
|
+
});
|
|
28
|
+
Object.defineProperty(exports1, '__esModule', {
|
|
29
|
+
value: true
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
})();
|
|
33
|
+
var __webpack_exports__ = {};
|
|
34
|
+
__webpack_require__.r(__webpack_exports__);
|
|
35
|
+
__webpack_require__.d(__webpack_exports__, {
|
|
36
|
+
Unlock: ()=>Unlock,
|
|
37
|
+
default: ()=>icons_Unlock
|
|
38
|
+
});
|
|
39
|
+
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
40
|
+
const external_react_namespaceObject = require("react");
|
|
41
|
+
var external_react_default = /*#__PURE__*/ __webpack_require__.n(external_react_namespaceObject);
|
|
42
|
+
const Unlock = /*#__PURE__*/ external_react_default().forwardRef(({ size, ...props }, ref)=>/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("svg", {
|
|
43
|
+
viewBox: "0 0 24 24",
|
|
44
|
+
fill: "none",
|
|
45
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
46
|
+
ref: ref,
|
|
47
|
+
...props,
|
|
48
|
+
width: size ?? 24,
|
|
49
|
+
height: size ?? 24,
|
|
50
|
+
children: /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)("path", {
|
|
51
|
+
d: "M6 21H18V11H6V21ZM12 18C12.55 18 13.0208 17.8042 13.4125 17.4125C13.8042 17.0208 14 16.55 14 16C14 15.45 13.8042 14.9792 13.4125 14.5875C13.0208 14.1958 12.55 14 12 14C11.45 14 10.9792 14.1958 10.5875 14.5875C10.1958 14.9792 10 15.45 10 16C10 16.55 10.1958 17.0208 10.5875 17.4125C10.9792 17.8042 11.45 18 12 18ZM6 23C5.45 23 4.97917 22.8042 4.5875 22.4125C4.19583 22.0208 4 21.55 4 21V11C4 10.45 4.19583 9.97917 4.5875 9.5875C4.97917 9.19583 5.45 9 6 9H13V7C13 5.61667 13.4875 4.4375 14.4625 3.4625C15.4375 2.4875 16.6167 2 18 2C19.3833 2 20.5625 2.4875 21.5375 3.4625C22.5125 4.4375 23 5.61667 23 7H21C21 6.16667 20.7083 5.45833 20.125 4.875C19.5417 4.29167 18.8333 4 18 4C17.1667 4 16.4583 4.29167 15.875 4.875C15.2917 5.45833 15 6.16667 15 7V9H18C18.55 9 19.0208 9.19583 19.4125 9.5875C19.8042 9.97917 20 10.45 20 11V21C20 21.55 19.8042 22.0208 19.4125 22.4125C19.0208 22.8042 18.55 23 18 23H6Z",
|
|
52
|
+
fill: "currentColor"
|
|
53
|
+
})
|
|
54
|
+
}));
|
|
55
|
+
Unlock.displayName = 'Unlock';
|
|
56
|
+
const icons_Unlock = Unlock;
|
|
57
|
+
exports.Unlock = __webpack_exports__.Unlock;
|
|
58
|
+
exports["default"] = __webpack_exports__["default"];
|
|
59
|
+
for(var __rspack_i in __webpack_exports__)if (-1 === [
|
|
60
|
+
"Unlock",
|
|
61
|
+
"default"
|
|
62
|
+
].indexOf(__rspack_i)) exports[__rspack_i] = __webpack_exports__[__rspack_i];
|
|
63
|
+
Object.defineProperty(exports, '__esModule', {
|
|
64
|
+
value: true
|
|
65
|
+
});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface UnlockProps extends Omit<React.SVGProps<SVGSVGElement>, 'width' | 'height'> {
|
|
3
|
+
/**
|
|
4
|
+
* Size to apply to both width and height.
|
|
5
|
+
* @default 24
|
|
6
|
+
*/
|
|
7
|
+
size?: string | number;
|
|
8
|
+
}
|
|
9
|
+
export declare const Unlock: React.ForwardRefExoticComponent<Omit<UnlockProps, "ref"> & React.RefAttributes<SVGSVGElement>>;
|
|
10
|
+
export default Unlock;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import react from "react";
|
|
3
|
+
const Unlock = /*#__PURE__*/ react.forwardRef(({ size, ...props }, ref)=>/*#__PURE__*/ jsx("svg", {
|
|
4
|
+
viewBox: "0 0 24 24",
|
|
5
|
+
fill: "none",
|
|
6
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
7
|
+
ref: ref,
|
|
8
|
+
...props,
|
|
9
|
+
width: size ?? 24,
|
|
10
|
+
height: size ?? 24,
|
|
11
|
+
children: /*#__PURE__*/ jsx("path", {
|
|
12
|
+
d: "M6 21H18V11H6V21ZM12 18C12.55 18 13.0208 17.8042 13.4125 17.4125C13.8042 17.0208 14 16.55 14 16C14 15.45 13.8042 14.9792 13.4125 14.5875C13.0208 14.1958 12.55 14 12 14C11.45 14 10.9792 14.1958 10.5875 14.5875C10.1958 14.9792 10 15.45 10 16C10 16.55 10.1958 17.0208 10.5875 17.4125C10.9792 17.8042 11.45 18 12 18ZM6 23C5.45 23 4.97917 22.8042 4.5875 22.4125C4.19583 22.0208 4 21.55 4 21V11C4 10.45 4.19583 9.97917 4.5875 9.5875C4.97917 9.19583 5.45 9 6 9H13V7C13 5.61667 13.4875 4.4375 14.4625 3.4625C15.4375 2.4875 16.6167 2 18 2C19.3833 2 20.5625 2.4875 21.5375 3.4625C22.5125 4.4375 23 5.61667 23 7H21C21 6.16667 20.7083 5.45833 20.125 4.875C19.5417 4.29167 18.8333 4 18 4C17.1667 4 16.4583 4.29167 15.875 4.875C15.2917 5.45833 15 6.16667 15 7V9H18C18.55 9 19.0208 9.19583 19.4125 9.5875C19.8042 9.97917 20 10.45 20 11V21C20 21.55 19.8042 22.0208 19.4125 22.4125C19.0208 22.8042 18.55 23 18 23H6Z",
|
|
13
|
+
fill: "currentColor"
|
|
14
|
+
})
|
|
15
|
+
}));
|
|
16
|
+
Unlock.displayName = 'Unlock';
|
|
17
|
+
const icons_Unlock = Unlock;
|
|
18
|
+
export { Unlock, icons_Unlock as default };
|
|
@@ -18,7 +18,7 @@ var __webpack_modules__ = {
|
|
|
18
18
|
"./avatar" (module) {
|
|
19
19
|
module.exports = require("./avatar.cjs");
|
|
20
20
|
},
|
|
21
|
-
"
|
|
21
|
+
"@/components/ui/badge" (module) {
|
|
22
22
|
module.exports = require("./badge.cjs");
|
|
23
23
|
},
|
|
24
24
|
"./boolean-radio-group" (module) {
|
|
@@ -51,13 +51,13 @@ var __webpack_modules__ = {
|
|
|
51
51
|
"./chat-hero" (module) {
|
|
52
52
|
module.exports = require("./chat-hero.cjs");
|
|
53
53
|
},
|
|
54
|
-
"
|
|
54
|
+
"@/components/ui/checkbox" (module) {
|
|
55
55
|
module.exports = require("./checkbox.cjs");
|
|
56
56
|
},
|
|
57
57
|
"./citation" (module) {
|
|
58
58
|
module.exports = require("./citation.cjs");
|
|
59
59
|
},
|
|
60
|
-
"
|
|
60
|
+
"./code-block" (module) {
|
|
61
61
|
module.exports = require("./code-block.cjs");
|
|
62
62
|
},
|
|
63
63
|
"./collapsible" (module) {
|
|
@@ -69,7 +69,7 @@ var __webpack_modules__ = {
|
|
|
69
69
|
"@/components/ui/command" (module) {
|
|
70
70
|
module.exports = require("./command.cjs");
|
|
71
71
|
},
|
|
72
|
-
"
|
|
72
|
+
"@/components/ui/context-menu" (module) {
|
|
73
73
|
module.exports = require("./context-menu.cjs");
|
|
74
74
|
},
|
|
75
75
|
"./data-table" (module) {
|
|
@@ -81,7 +81,7 @@ var __webpack_modules__ = {
|
|
|
81
81
|
"./datetime-picker" (module) {
|
|
82
82
|
module.exports = require("./datetime-picker.cjs");
|
|
83
83
|
},
|
|
84
|
-
"
|
|
84
|
+
"./dialog" (module) {
|
|
85
85
|
module.exports = require("./dialog.cjs");
|
|
86
86
|
},
|
|
87
87
|
"./disclosure-tree" (module) {
|
|
@@ -129,7 +129,7 @@ var __webpack_modules__ = {
|
|
|
129
129
|
"@/components/ui/input-group" (module) {
|
|
130
130
|
module.exports = require("./input-group.cjs");
|
|
131
131
|
},
|
|
132
|
-
"
|
|
132
|
+
"@/components/ui/input" (module) {
|
|
133
133
|
module.exports = require("./input.cjs");
|
|
134
134
|
},
|
|
135
135
|
"./json-tree-view" (module) {
|
|
@@ -138,7 +138,7 @@ var __webpack_modules__ = {
|
|
|
138
138
|
"./label" (module) {
|
|
139
139
|
module.exports = require("./label.cjs");
|
|
140
140
|
},
|
|
141
|
-
"
|
|
141
|
+
"@/components/ui/layout" (module) {
|
|
142
142
|
module.exports = require("./layout/index.cjs");
|
|
143
143
|
},
|
|
144
144
|
"./live-region" (module) {
|
|
@@ -180,7 +180,7 @@ var __webpack_modules__ = {
|
|
|
180
180
|
"./panel-tabs" (module) {
|
|
181
181
|
module.exports = require("./panel-tabs.cjs");
|
|
182
182
|
},
|
|
183
|
-
"
|
|
183
|
+
"@/components/ui/popover" (module) {
|
|
184
184
|
module.exports = require("./popover.cjs");
|
|
185
185
|
},
|
|
186
186
|
"@/components/ui/portal-container" (module) {
|
|
@@ -207,7 +207,7 @@ var __webpack_modules__ = {
|
|
|
207
207
|
"./reference-chip-colors" (module) {
|
|
208
208
|
module.exports = require("./reference-chip-colors.cjs");
|
|
209
209
|
},
|
|
210
|
-
"
|
|
210
|
+
"@/components/ui/reference-chip" (module) {
|
|
211
211
|
module.exports = require("./reference-chip.cjs");
|
|
212
212
|
},
|
|
213
213
|
"./resizable" (module) {
|
|
@@ -255,7 +255,7 @@ var __webpack_modules__ = {
|
|
|
255
255
|
"./switch" (module) {
|
|
256
256
|
module.exports = require("./switch.cjs");
|
|
257
257
|
},
|
|
258
|
-
"
|
|
258
|
+
"@/components/ui/table" (module) {
|
|
259
259
|
module.exports = require("./table.cjs");
|
|
260
260
|
},
|
|
261
261
|
"./tabs" (module) {
|
|
@@ -270,7 +270,7 @@ var __webpack_modules__ = {
|
|
|
270
270
|
"./toggle-group" (module) {
|
|
271
271
|
module.exports = require("./toggle-group.cjs");
|
|
272
272
|
},
|
|
273
|
-
"
|
|
273
|
+
"./toggle" (module) {
|
|
274
274
|
module.exports = require("./toggle.cjs");
|
|
275
275
|
},
|
|
276
276
|
"./tool-call" (module) {
|
|
@@ -282,7 +282,7 @@ var __webpack_modules__ = {
|
|
|
282
282
|
"./tree-view" (module) {
|
|
283
283
|
module.exports = require("./tree-view.cjs");
|
|
284
284
|
},
|
|
285
|
-
"
|
|
285
|
+
"@/components/ui/variable-picker" (module) {
|
|
286
286
|
module.exports = require("./variable-picker/index.cjs");
|
|
287
287
|
},
|
|
288
288
|
"./variable-value-control" (module) {
|
|
@@ -398,7 +398,7 @@ var __webpack_exports__ = {};
|
|
|
398
398
|
"ReferenceChip"
|
|
399
399
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_avatar__rspack_import_5[__rspack_import_key];
|
|
400
400
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
401
|
-
var _badge__rspack_import_6 = __webpack_require__("
|
|
401
|
+
var _badge__rspack_import_6 = __webpack_require__("@/components/ui/badge");
|
|
402
402
|
var __rspack_reexport = {};
|
|
403
403
|
for(const __rspack_import_key in _badge__rspack_import_6)if ([
|
|
404
404
|
"getReferenceChipColors",
|
|
@@ -508,7 +508,7 @@ var __webpack_exports__ = {};
|
|
|
508
508
|
"ReferenceChip"
|
|
509
509
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_chat_hero__rspack_import_16[__rspack_import_key];
|
|
510
510
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
511
|
-
var _checkbox__rspack_import_17 = __webpack_require__("
|
|
511
|
+
var _checkbox__rspack_import_17 = __webpack_require__("@/components/ui/checkbox");
|
|
512
512
|
var __rspack_reexport = {};
|
|
513
513
|
for(const __rspack_import_key in _checkbox__rspack_import_17)if ([
|
|
514
514
|
"getReferenceChipColors",
|
|
@@ -528,7 +528,7 @@ var __webpack_exports__ = {};
|
|
|
528
528
|
"ReferenceChip"
|
|
529
529
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_citation__rspack_import_18[__rspack_import_key];
|
|
530
530
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
531
|
-
var _code_block__rspack_import_19 = __webpack_require__("
|
|
531
|
+
var _code_block__rspack_import_19 = __webpack_require__("./code-block");
|
|
532
532
|
var __rspack_reexport = {};
|
|
533
533
|
for(const __rspack_import_key in _code_block__rspack_import_19)if ([
|
|
534
534
|
"getReferenceChipColors",
|
|
@@ -568,7 +568,7 @@ var __webpack_exports__ = {};
|
|
|
568
568
|
"ReferenceChip"
|
|
569
569
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_command__rspack_import_22[__rspack_import_key];
|
|
570
570
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
571
|
-
var _context_menu__rspack_import_23 = __webpack_require__("
|
|
571
|
+
var _context_menu__rspack_import_23 = __webpack_require__("@/components/ui/context-menu");
|
|
572
572
|
var __rspack_reexport = {};
|
|
573
573
|
for(const __rspack_import_key in _context_menu__rspack_import_23)if ([
|
|
574
574
|
"getReferenceChipColors",
|
|
@@ -608,7 +608,7 @@ var __webpack_exports__ = {};
|
|
|
608
608
|
"ReferenceChip"
|
|
609
609
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_datetime_picker__rspack_import_26[__rspack_import_key];
|
|
610
610
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
611
|
-
var _dialog__rspack_import_27 = __webpack_require__("
|
|
611
|
+
var _dialog__rspack_import_27 = __webpack_require__("./dialog");
|
|
612
612
|
var __rspack_reexport = {};
|
|
613
613
|
for(const __rspack_import_key in _dialog__rspack_import_27)if ([
|
|
614
614
|
"getReferenceChipColors",
|
|
@@ -758,7 +758,7 @@ var __webpack_exports__ = {};
|
|
|
758
758
|
"ReferenceChip"
|
|
759
759
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_info_tooltip__rspack_import_41[__rspack_import_key];
|
|
760
760
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
761
|
-
var _input__rspack_import_42 = __webpack_require__("
|
|
761
|
+
var _input__rspack_import_42 = __webpack_require__("@/components/ui/input");
|
|
762
762
|
var __rspack_reexport = {};
|
|
763
763
|
for(const __rspack_import_key in _input__rspack_import_42)if ([
|
|
764
764
|
"getReferenceChipColors",
|
|
@@ -798,7 +798,7 @@ var __webpack_exports__ = {};
|
|
|
798
798
|
"ReferenceChip"
|
|
799
799
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_label__rspack_import_45[__rspack_import_key];
|
|
800
800
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
801
|
-
var _layout__rspack_import_46 = __webpack_require__("
|
|
801
|
+
var _layout__rspack_import_46 = __webpack_require__("@/components/ui/layout");
|
|
802
802
|
var __rspack_reexport = {};
|
|
803
803
|
for(const __rspack_import_key in _layout__rspack_import_46)if ([
|
|
804
804
|
"getReferenceChipColors",
|
|
@@ -938,7 +938,7 @@ var __webpack_exports__ = {};
|
|
|
938
938
|
"ReferenceChip"
|
|
939
939
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_panel_tabs__rspack_import_59[__rspack_import_key];
|
|
940
940
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
941
|
-
var _popover__rspack_import_60 = __webpack_require__("
|
|
941
|
+
var _popover__rspack_import_60 = __webpack_require__("@/components/ui/popover");
|
|
942
942
|
var __rspack_reexport = {};
|
|
943
943
|
for(const __rspack_import_key in _popover__rspack_import_60)if ([
|
|
944
944
|
"getReferenceChipColors",
|
|
@@ -1018,7 +1018,7 @@ var __webpack_exports__ = {};
|
|
|
1018
1018
|
"ReferenceChip"
|
|
1019
1019
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_radio_group__rspack_import_67[__rspack_import_key];
|
|
1020
1020
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
1021
|
-
var _reference_chip__rspack_import_68 = __webpack_require__("
|
|
1021
|
+
var _reference_chip__rspack_import_68 = __webpack_require__("@/components/ui/reference-chip");
|
|
1022
1022
|
var _reference_chip_colors__rspack_import_69 = __webpack_require__("./reference-chip-colors");
|
|
1023
1023
|
var _resizable__rspack_import_70 = __webpack_require__("./resizable");
|
|
1024
1024
|
var __rspack_reexport = {};
|
|
@@ -1170,7 +1170,7 @@ var __webpack_exports__ = {};
|
|
|
1170
1170
|
"ReferenceChip"
|
|
1171
1171
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_switch__rspack_import_84[__rspack_import_key];
|
|
1172
1172
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
1173
|
-
var _table__rspack_import_85 = __webpack_require__("
|
|
1173
|
+
var _table__rspack_import_85 = __webpack_require__("@/components/ui/table");
|
|
1174
1174
|
var __rspack_reexport = {};
|
|
1175
1175
|
for(const __rspack_import_key in _table__rspack_import_85)if ([
|
|
1176
1176
|
"getReferenceChipColors",
|
|
@@ -1210,7 +1210,7 @@ var __webpack_exports__ = {};
|
|
|
1210
1210
|
"ReferenceChip"
|
|
1211
1211
|
].indexOf(__rspack_import_key) < 0) __rspack_reexport[__rspack_import_key] = ()=>_thinking_indicator__rspack_import_88[__rspack_import_key];
|
|
1212
1212
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
1213
|
-
var _toggle__rspack_import_89 = __webpack_require__("
|
|
1213
|
+
var _toggle__rspack_import_89 = __webpack_require__("./toggle");
|
|
1214
1214
|
var __rspack_reexport = {};
|
|
1215
1215
|
for(const __rspack_import_key in _toggle__rspack_import_89)if ([
|
|
1216
1216
|
"getReferenceChipColors",
|
|
@@ -1252,7 +1252,7 @@ var __webpack_exports__ = {};
|
|
|
1252
1252
|
__webpack_require__.d(__webpack_exports__, __rspack_reexport);
|
|
1253
1253
|
var _tree_view__rspack_import_93 = __webpack_require__("./tree-view");
|
|
1254
1254
|
var _tree_view__rspack_import_93_default = /*#__PURE__*/ __webpack_require__.n(_tree_view__rspack_import_93);
|
|
1255
|
-
var _variable_picker__rspack_import_94 = __webpack_require__("
|
|
1255
|
+
var _variable_picker__rspack_import_94 = __webpack_require__("@/components/ui/variable-picker");
|
|
1256
1256
|
var __rspack_reexport = {};
|
|
1257
1257
|
for(const __rspack_import_key in _variable_picker__rspack_import_94)if ([
|
|
1258
1258
|
"getReferenceChipColors",
|
|
@@ -27,7 +27,8 @@ __webpack_require__.d(__webpack_exports__, {
|
|
|
27
27
|
LockToggleButton: ()=>LockToggleButton
|
|
28
28
|
});
|
|
29
29
|
const jsx_runtime_namespaceObject = require("react/jsx-runtime");
|
|
30
|
-
const
|
|
30
|
+
const Lock_cjs_namespaceObject = require("../../../icons/Lock.cjs");
|
|
31
|
+
const Unlock_cjs_namespaceObject = require("../../../icons/Unlock.cjs");
|
|
31
32
|
const field_addon_button_cjs_namespaceObject = require("../../field-addons/field-addon-button.cjs");
|
|
32
33
|
const external_input_group_cjs_namespaceObject = require("../../input-group.cjs");
|
|
33
34
|
const external_tooltip_cjs_namespaceObject = require("../../tooltip.cjs");
|
|
@@ -45,11 +46,7 @@ function LockToggleButton({ locked, onLockedChange, disabled, strings }) {
|
|
|
45
46
|
disabled: !interactive,
|
|
46
47
|
onClick: ()=>onLockedChange?.(!locked),
|
|
47
48
|
"aria-label": interactive ? locked ? strings.lockedHint : strings.unlockedHint : locked ? strings.lockedLabel : strings.unlockedLabel,
|
|
48
|
-
children: locked ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(
|
|
49
|
-
size: 16
|
|
50
|
-
}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_lucide_react_namespaceObject.LockKeyholeOpen, {
|
|
51
|
-
size: 16
|
|
52
|
-
})
|
|
49
|
+
children: locked ? /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Lock_cjs_namespaceObject.Lock, {}) : /*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(Unlock_cjs_namespaceObject.Unlock, {})
|
|
53
50
|
})
|
|
54
51
|
}),
|
|
55
52
|
/*#__PURE__*/ (0, jsx_runtime_namespaceObject.jsx)(external_tooltip_cjs_namespaceObject.TooltipContent, {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import {
|
|
2
|
+
import { Lock } from "../../../icons/Lock.js";
|
|
3
|
+
import { Unlock } from "../../../icons/Unlock.js";
|
|
3
4
|
import { FIELD_ADDON_BUTTON_CLASS } from "../../field-addons/field-addon-button.js";
|
|
4
5
|
import { InputGroupButton } from "../../input-group.js";
|
|
5
6
|
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "../../tooltip.js";
|
|
@@ -17,11 +18,7 @@ function LockToggleButton({ locked, onLockedChange, disabled, strings }) {
|
|
|
17
18
|
disabled: !interactive,
|
|
18
19
|
onClick: ()=>onLockedChange?.(!locked),
|
|
19
20
|
"aria-label": interactive ? locked ? strings.lockedHint : strings.unlockedHint : locked ? strings.lockedLabel : strings.unlockedLabel,
|
|
20
|
-
children: locked ? /*#__PURE__*/ jsx(
|
|
21
|
-
size: 16
|
|
22
|
-
}) : /*#__PURE__*/ jsx(LockKeyholeOpen, {
|
|
23
|
-
size: 16
|
|
24
|
-
})
|
|
21
|
+
children: locked ? /*#__PURE__*/ jsx(Lock, {}) : /*#__PURE__*/ jsx(Unlock, {})
|
|
25
22
|
})
|
|
26
23
|
}),
|
|
27
24
|
/*#__PURE__*/ jsx(TooltipContent, {
|
package/dist/styles.css
CHANGED
|
@@ -13923,19 +13923,21 @@ body.canvas, .canvas {
|
|
|
13923
13923
|
.future-dark, .dark, .dark-hc {
|
|
13924
13924
|
scrollbar-width: thin;
|
|
13925
13925
|
scrollbar-color: var(--color-border) transparent;
|
|
13926
|
-
|
|
13927
|
-
|
|
13928
|
-
|
|
13929
|
-
|
|
13930
|
-
|
|
13931
|
-
|
|
13932
|
-
|
|
13933
|
-
|
|
13934
|
-
|
|
13935
|
-
|
|
13936
|
-
|
|
13937
|
-
|
|
13938
|
-
|
|
13926
|
+
@supports not (scrollbar-color: auto) {
|
|
13927
|
+
& *::-webkit-scrollbar {
|
|
13928
|
+
width: 6px;
|
|
13929
|
+
height: 6px;
|
|
13930
|
+
}
|
|
13931
|
+
& *::-webkit-scrollbar-track {
|
|
13932
|
+
background: transparent;
|
|
13933
|
+
}
|
|
13934
|
+
& *::-webkit-scrollbar-thumb {
|
|
13935
|
+
background-color: var(--color-border);
|
|
13936
|
+
border-radius: 9999px;
|
|
13937
|
+
}
|
|
13938
|
+
& *::-webkit-scrollbar-thumb:hover {
|
|
13939
|
+
background-color: var(--color-border-hover);
|
|
13940
|
+
}
|
|
13939
13941
|
}
|
|
13940
13942
|
}
|
|
13941
13943
|
.mat-typography :is( [data-slot="dialog-content"], [data-slot="sheet-content"], [data-slot="alert-dialog-content"], [data-slot="drawer-content"] ) :where(p) {
|
package/dist/tailwind.css
CHANGED
|
@@ -897,32 +897,42 @@ body.canvas, .canvas {
|
|
|
897
897
|
* Dark themes: future-dark + dark-hc are applied to <html>;
|
|
898
898
|
* dark + dark-hc are applied to <body>. Both cases are covered by the
|
|
899
899
|
* class selectors below since * matches all descendants.
|
|
900
|
+
*
|
|
901
|
+
* The standard properties inherit, so they cost nothing per element. The
|
|
902
|
+
* WebKit pseudo-element rules do not: `.dark *::-webkit-scrollbar` makes
|
|
903
|
+
* Chrome walk every element's ancestors for the theme class on every style
|
|
904
|
+
* recalc (about 7 ms per copy of this block in Studio Web, MST-17369).
|
|
905
|
+
* Browsers that implement `scrollbar-color` ignore `::-webkit-scrollbar`
|
|
906
|
+
* once it is set (Chrome 121+, Safari 26.2+), so the WebKit rules only
|
|
907
|
+
* exist where the standard properties are missing.
|
|
900
908
|
* ============================================================================ */
|
|
901
909
|
|
|
902
910
|
.future-dark,
|
|
903
911
|
.dark,
|
|
904
912
|
.dark-hc {
|
|
905
|
-
/* Firefox — inherits down the tree */
|
|
913
|
+
/* Firefox, Chrome 121+, Safari 26.2+ — inherits down the tree */
|
|
906
914
|
scrollbar-width: thin;
|
|
907
915
|
scrollbar-color: var(--color-border) transparent;
|
|
908
916
|
|
|
909
|
-
/* WebKit — pseudo-elements don't inherit, must target descendants */
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
917
|
+
/* Older WebKit — pseudo-elements don't inherit, must target descendants */
|
|
918
|
+
@supports not (scrollbar-color: auto) {
|
|
919
|
+
& *::-webkit-scrollbar {
|
|
920
|
+
width: 6px;
|
|
921
|
+
height: 6px;
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
& *::-webkit-scrollbar-track {
|
|
925
|
+
background: transparent;
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
& *::-webkit-scrollbar-thumb {
|
|
929
|
+
background-color: var(--color-border);
|
|
930
|
+
border-radius: 9999px;
|
|
931
|
+
}
|
|
932
|
+
|
|
933
|
+
& *::-webkit-scrollbar-thumb:hover {
|
|
934
|
+
background-color: var(--color-border-hover);
|
|
935
|
+
}
|
|
926
936
|
}
|
|
927
937
|
}
|
|
928
938
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@uipath/apollo-wind",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.84.0",
|
|
4
4
|
"description": "UiPath wind design system - A Tailwind CSS based React component library",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -51,6 +51,11 @@
|
|
|
51
51
|
"import": "./dist/postcss.config.export.js",
|
|
52
52
|
"require": "./dist/postcss.config.export.cjs"
|
|
53
53
|
},
|
|
54
|
+
"./postcss-scope-preflight": {
|
|
55
|
+
"types": "./postcss-scope-preflight.d.ts",
|
|
56
|
+
"import": "./postcss-scope-preflight.js",
|
|
57
|
+
"default": "./postcss-scope-preflight.js"
|
|
58
|
+
},
|
|
54
59
|
"./editor-themes": {
|
|
55
60
|
"import": "./dist/editor-themes/index.js",
|
|
56
61
|
"require": "./dist/editor-themes/index.cjs",
|
|
@@ -59,7 +64,9 @@
|
|
|
59
64
|
},
|
|
60
65
|
"files": [
|
|
61
66
|
"dist",
|
|
62
|
-
"postcss.config.export.js"
|
|
67
|
+
"postcss.config.export.js",
|
|
68
|
+
"postcss-scope-preflight.js",
|
|
69
|
+
"postcss-scope-preflight.d.ts"
|
|
63
70
|
],
|
|
64
71
|
"peerDependencies": {
|
|
65
72
|
"react": ">=18.0.0",
|
|
@@ -176,7 +183,8 @@
|
|
|
176
183
|
"semantic-release": "^25.0.3",
|
|
177
184
|
"storybook": "^10.6.2",
|
|
178
185
|
"typescript": "^5.9.3",
|
|
179
|
-
"vitest": "^4.1.12"
|
|
186
|
+
"vitest": "^4.1.12",
|
|
187
|
+
"@uipath/apollo-ui-icons-react": "0.0.0"
|
|
180
188
|
},
|
|
181
189
|
"keywords": [
|
|
182
190
|
"react",
|
|
@@ -211,6 +219,7 @@
|
|
|
211
219
|
"format:check": "biome format .",
|
|
212
220
|
"storybook": "storybook dev -p 6006",
|
|
213
221
|
"storybook:build": "storybook build",
|
|
214
|
-
"clean": "rm -rf dist"
|
|
222
|
+
"clean": "rm -rf dist",
|
|
223
|
+
"sync:icons": "tsx scripts/icons-sync.ts"
|
|
215
224
|
}
|
|
216
225
|
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { Plugin, PluginCreator } from 'postcss';
|
|
2
|
+
|
|
3
|
+
export interface ScopePreflightOptions {
|
|
4
|
+
/**
|
|
5
|
+
* Selectors for the elements that own the consumer's DOM: web-component tags, portal markers,
|
|
6
|
+
* `[data-slot]`. Preflight applies to these elements and their descendants.
|
|
7
|
+
*/
|
|
8
|
+
roots: string[];
|
|
9
|
+
/**
|
|
10
|
+
* Preflight's `html, :host` rule sets the page font from `--font-sans`, a `:root` variable every
|
|
11
|
+
* consumer in a shared document redefines. By default the font declarations stay on the outermost
|
|
12
|
+
* root. Pass the selector of the element the consumer renders when it owns the whole document to
|
|
13
|
+
* apply them there only, so embedded roots inherit the host's font; pass `false` to drop them.
|
|
14
|
+
*/
|
|
15
|
+
documentRoot?: string | false;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** Inserts `:where(:scope)` into the subject of a selector, ahead of any pseudo-element. */
|
|
19
|
+
export function scopeSelector(selector: string): string;
|
|
20
|
+
|
|
21
|
+
declare const scopePreflight: PluginCreator<ScopePreflightOptions> &
|
|
22
|
+
((options: ScopePreflightOptions) => Plugin);
|
|
23
|
+
export default scopePreflight;
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PostCSS plugin: confine Tailwind's Preflight reset to the DOM a consumer renders.
|
|
3
|
+
*
|
|
4
|
+
* A micro-frontend's CSS lands in its host's document. Preflight is written for a page you own:
|
|
5
|
+
* left global it restyles the host's markup, and its `[hidden] { display: none !important }` beats
|
|
6
|
+
* the host's own unlayered `display` rules. This plugin wraps the Preflight rules, and the bare `*`
|
|
7
|
+
* resets apollo-wind adds to `@layer base`, in `@scope (roots) { … }`, so they match only inside the
|
|
8
|
+
* consumer's own root elements.
|
|
9
|
+
*
|
|
10
|
+
* `@scope` is the cheap way to do this. The older `X:where(R1, …, Rn, R1 *, …, Rn *)` wrapper makes
|
|
11
|
+
* Chrome walk every element's ancestor chain once per root for every universal Preflight rule, which
|
|
12
|
+
* showed up as 100+ ms style recalcs in Studio Web (MST-17369). Inside `@scope`, a bare selector
|
|
13
|
+
* matches descendants of the root only, so each rule also gets an `X:where(:scope)` copy for the root
|
|
14
|
+
* itself. `:where()` keeps Preflight at zero specificity, as upstream.
|
|
15
|
+
*
|
|
16
|
+
* Runs after Tailwind. Preflight is found by shape, not source file: Tailwind's production optimise
|
|
17
|
+
* pass re-parses its output, so every rule reports the entry file as its source. The run starts at
|
|
18
|
+
* the `::backdrop` box-sizing rule and ends at `[hidden]:where(:not([hidden=until-found]))`; if a
|
|
19
|
+
* Tailwind update moves the end, the plugin throws rather than scope the rest of the base layer. If
|
|
20
|
+
* the start moves, nothing is scoped: the test against real Tailwind output in `src/styles` is what
|
|
21
|
+
* catches that, so keep it when bumping Tailwind.
|
|
22
|
+
*
|
|
23
|
+
* Two cascade details for consumers:
|
|
24
|
+
*
|
|
25
|
+
* - Scoping proximity ranks below specificity but above source order. A scoped Preflight
|
|
26
|
+
* declaration therefore beats an unscoped one of equal specificity in the same layer, whatever
|
|
27
|
+
* the order, which the old wrapper did not. Override Preflight from an unlayered rule or with
|
|
28
|
+
* higher specificity, not from a later rule in `@layer base`.
|
|
29
|
+
* - Safari 26.0 to 26.3 do not apply `@scope` rules to elements with a UA shadow root (`input`,
|
|
30
|
+
* `textarea`; WebKit 305369, fixed in 26.4). Form controls render with UA styles there. Those
|
|
31
|
+
* versions are outside UiPath's support matrix (Safari: latest version only), and `@supports`
|
|
32
|
+
* cannot detect the bug, so there is no workaround.
|
|
33
|
+
*
|
|
34
|
+
* Usage, in a consumer's postcss config:
|
|
35
|
+
*
|
|
36
|
+
* import apolloWind from '@uipath/apollo-wind/postcss';
|
|
37
|
+
* import scopePreflight from '@uipath/apollo-wind/postcss-scope-preflight';
|
|
38
|
+
* export default { plugins: [...apolloWind.plugins, scopePreflight({ roots: ['my-canvas', '[data-my-portal]'] })] };
|
|
39
|
+
*
|
|
40
|
+
* Anything the consumer portals onto `document.body` must carry one of the roots, or it renders
|
|
41
|
+
* without Preflight. apollo-wind stamps `data-slot` on its components, including what it portals, so
|
|
42
|
+
* `[data-slot]` is a sensible root for apollo-wind consumers.
|
|
43
|
+
*/
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* @typedef {object} ScopePreflightOptions
|
|
47
|
+
* @property {string[]} roots
|
|
48
|
+
* Selectors for the elements that own the consumer's DOM: web-component tags, portal markers,
|
|
49
|
+
* `[data-slot]`. Preflight applies to these elements and their descendants.
|
|
50
|
+
* @property {string | false} [documentRoot]
|
|
51
|
+
* Preflight's `html, :host` rule sets the page font from `--font-sans`, a `:root` variable every
|
|
52
|
+
* consumer in a shared document redefines. By default the font declarations stay on the outermost
|
|
53
|
+
* root. Pass the selector of the element the consumer renders when it owns the whole document to
|
|
54
|
+
* apply them there only, so embedded roots inherit the host's font; pass `false` to drop them.
|
|
55
|
+
*/
|
|
56
|
+
|
|
57
|
+
/** Preflight's first rule: the `*, ::before, ::after, ::backdrop` box-sizing reset. */
|
|
58
|
+
const isPreflightStart = (/** @type {import('postcss').Rule} */ rule) =>
|
|
59
|
+
rule.selectors.some((s) => s.trim() === '::backdrop') &&
|
|
60
|
+
rule.some((d) => d.type === 'decl' && d.prop === 'box-sizing');
|
|
61
|
+
|
|
62
|
+
/** Preflight's last rule. */
|
|
63
|
+
const isPreflightEnd = (/** @type {import('postcss').Rule} */ rule) =>
|
|
64
|
+
/^\[hidden\]:where\(:not\(\[hidden=["']?until-found["']?\]\)\)$/.test(rule.selector.trim());
|
|
65
|
+
|
|
66
|
+
/** @param {string} selector */
|
|
67
|
+
const isDocumentRoot = (selector) => selector === 'html' || selector === ':host';
|
|
68
|
+
|
|
69
|
+
/** The inherited typography `html, :host` sets; on an embedded root these follow the host instead. */
|
|
70
|
+
const DOCUMENT_FONT_PROPS = new Set([
|
|
71
|
+
'font-family',
|
|
72
|
+
'font-feature-settings',
|
|
73
|
+
'font-variation-settings',
|
|
74
|
+
]);
|
|
75
|
+
|
|
76
|
+
// Tailwind's production pass prints `::before`/`::after` in their single-colon form; a pseudo-class
|
|
77
|
+
// after one is invalid, and the minifier empties it to `:where()`.
|
|
78
|
+
const LEGACY_PSEUDO_ELEMENT = /^:(before|after|first-line|first-letter)(?![\w-])/;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Inserts `:where(:scope)` into the subject (last compound) of a selector, ahead of any pseudo-element.
|
|
82
|
+
* @param {string} selector
|
|
83
|
+
*/
|
|
84
|
+
export function scopeSelector(selector) {
|
|
85
|
+
const s = selector.trim();
|
|
86
|
+
let depth = 0;
|
|
87
|
+
let subjectStart = 0;
|
|
88
|
+
for (let i = 0; i < s.length; i++) {
|
|
89
|
+
const c = s[i];
|
|
90
|
+
if (c === '(' || c === '[') depth++;
|
|
91
|
+
else if (c === ')' || c === ']') depth--;
|
|
92
|
+
else if (depth === 0 && (c === ' ' || c === '>' || c === '+' || c === '~'))
|
|
93
|
+
subjectStart = i + 1;
|
|
94
|
+
}
|
|
95
|
+
depth = 0;
|
|
96
|
+
for (let i = subjectStart; i < s.length; i++) {
|
|
97
|
+
const c = s[i];
|
|
98
|
+
if (c === '(' || c === '[') depth++;
|
|
99
|
+
else if (c === ')' || c === ']') depth--;
|
|
100
|
+
else if (
|
|
101
|
+
depth === 0 &&
|
|
102
|
+
c === ':' &&
|
|
103
|
+
(s[i + 1] === ':' || LEGACY_PSEUDO_ELEMENT.test(s.slice(i)))
|
|
104
|
+
)
|
|
105
|
+
return `${s.slice(0, i)}:where(:scope)${s.slice(i)}`;
|
|
106
|
+
}
|
|
107
|
+
return `${s}:where(:scope)`;
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* @param {ScopePreflightOptions} options
|
|
112
|
+
* @returns {import('postcss').Plugin}
|
|
113
|
+
*/
|
|
114
|
+
const scopePreflight = (options) => {
|
|
115
|
+
const roots = options?.roots?.map((r) => r.trim()).filter(Boolean) ?? [];
|
|
116
|
+
if (roots.length === 0)
|
|
117
|
+
throw new Error('scope-preflight: `roots` must list at least one selector');
|
|
118
|
+
const { documentRoot } = options;
|
|
119
|
+
|
|
120
|
+
const ROOTS = roots.join(', ');
|
|
121
|
+
// The outermost root only: `html, :host` sets inherited typography, and on every nested root it
|
|
122
|
+
// would override what the component's parent chose. Flat lists, no `:is()`: minifiers lower `:is()`
|
|
123
|
+
// into `:-webkit-any()`/`:-moz-any()` copies.
|
|
124
|
+
const SCOPE_TOP = `:where(${ROOTS}):where(:not(${roots.map((r) => `${r} *`).join(', ')}))`;
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Rewrites one rule for use inside the `@scope` block: a `:where(:scope)` copy for the root, the
|
|
128
|
+
* bare selector for its descendants.
|
|
129
|
+
* @param {import('postcss').Rule} rule
|
|
130
|
+
*/
|
|
131
|
+
const scopeRule = (rule) => {
|
|
132
|
+
const selectors = rule.selectors.map((s) => s.trim());
|
|
133
|
+
rule.selectors = [...selectors.map(scopeSelector), ...selectors];
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* `html, :host` becomes a rule on the outermost root, outside the block. Its font declarations move
|
|
138
|
+
* to `documentRoot`, or are dropped, when the consumer asked for that.
|
|
139
|
+
* @param {import('postcss').Rule} rule
|
|
140
|
+
* @param {import('postcss').Helpers} helpers
|
|
141
|
+
*/
|
|
142
|
+
const scopeDocumentRule = (rule, { Rule }) => {
|
|
143
|
+
if (documentRoot !== undefined) {
|
|
144
|
+
const fontDecls = rule.nodes.filter(
|
|
145
|
+
(n) => n.type === 'decl' && DOCUMENT_FONT_PROPS.has(n.prop)
|
|
146
|
+
);
|
|
147
|
+
for (const decl of fontDecls) decl.remove();
|
|
148
|
+
if (documentRoot && fontDecls.length) {
|
|
149
|
+
rule.after(
|
|
150
|
+
new Rule({ selector: `:where(${documentRoot})`, nodes: fontDecls.map((d) => d.clone()) })
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
rule.selector = SCOPE_TOP;
|
|
155
|
+
if (rule.nodes.length === 0) rule.remove();
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
return {
|
|
159
|
+
postcssPlugin: 'scope-preflight',
|
|
160
|
+
OnceExit(root, helpers) {
|
|
161
|
+
const { AtRule } = helpers;
|
|
162
|
+
root.walkAtRules('layer', (layer) => {
|
|
163
|
+
if (layer.params !== 'base') return;
|
|
164
|
+
// Collect the nodes to scope first, so the walk is not disturbed by the rewrite.
|
|
165
|
+
/** @type {import('postcss').ChildNode[]} */
|
|
166
|
+
const toScope = [];
|
|
167
|
+
let inPreflight = false;
|
|
168
|
+
for (const node of layer.nodes ?? []) {
|
|
169
|
+
if (node.type === 'atrule') {
|
|
170
|
+
if (inPreflight) toScope.push(node);
|
|
171
|
+
continue;
|
|
172
|
+
}
|
|
173
|
+
if (node.type !== 'rule') continue;
|
|
174
|
+
if (isPreflightStart(node)) inPreflight = true;
|
|
175
|
+
if (inPreflight) {
|
|
176
|
+
toScope.push(node);
|
|
177
|
+
if (isPreflightEnd(node)) inPreflight = false;
|
|
178
|
+
} else if (node.selector.trim() === '*') {
|
|
179
|
+
// A bare `*` in the base layer (apollo-wind's `border-color`) is the same kind of page-wide reset.
|
|
180
|
+
toScope.push(node);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
if (inPreflight) {
|
|
184
|
+
// Scoping on to the end of the layer would also wrap the consumer's own base rules
|
|
185
|
+
// (`body { … }` matches nothing inside a root), with no build error. Fail instead.
|
|
186
|
+
throw layer.error(
|
|
187
|
+
'scope-preflight: found the start of Preflight but not its last rule, `[hidden]:where(:not([hidden=until-found]))`. Tailwind may have changed Preflight; update isPreflightEnd.',
|
|
188
|
+
{ plugin: 'scope-preflight' }
|
|
189
|
+
);
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
// One `@scope` block per run of consecutive nodes. Chrome resolves scope activations per
|
|
193
|
+
// block, so hundreds of single-rule blocks cost measurably more than a handful.
|
|
194
|
+
/** @type {import('postcss').AtRule | null} */
|
|
195
|
+
let block = null;
|
|
196
|
+
for (const node of toScope) {
|
|
197
|
+
if (!block || node.prev() !== block) {
|
|
198
|
+
block = new AtRule({ name: 'scope', params: `(${ROOTS})` });
|
|
199
|
+
node.before(block);
|
|
200
|
+
}
|
|
201
|
+
if (node.type === 'rule' && node.selectors.map((s) => s.trim()).every(isDocumentRoot)) {
|
|
202
|
+
// Stays outside the block, ahead of it, so its position in the cascade does not change.
|
|
203
|
+
block.before(node);
|
|
204
|
+
scopeDocumentRule(node, helpers);
|
|
205
|
+
// The next node is still adjacent to the block.
|
|
206
|
+
continue;
|
|
207
|
+
}
|
|
208
|
+
if (node.type === 'rule') scopeRule(node);
|
|
209
|
+
else node.walkRules(scopeRule);
|
|
210
|
+
block.append(node);
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
},
|
|
214
|
+
};
|
|
215
|
+
};
|
|
216
|
+
scopePreflight.postcss = true;
|
|
217
|
+
|
|
218
|
+
export default scopePreflight;
|