@patternfly/pfe-core 2.0.0-next.2 → 2.0.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/core.js +1 -1
- package/core.js.map +2 -2
- package/package.json +24 -93
package/core.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var o=Symbol();function r(e){return document.head.querySelector(`meta[name="${e}"]`)?.content}function f(e=o){return e!==o&&(window.PfeConfig.trackPerformance=!!e),window.PfeConfig.trackPerformance}var l={fromAttribute(e){return typeof e!="string"?null:e.split(",").map(t=>t.trim()).map(t=>parseInt(t,10))},toAttribute(e){return e.join(",")}},i=class extends Event{constructor(t,a){super(t,{bubbles:!0,composed:!0,...a})}},n=document.body.hasAttribute("no-auto-reveal");window.PfeConfig=Object.assign(window.PfeConfig??{},{trackPerformance:window.PfeConfig?.trackPerformance??r("pfe-track-performance")==="true",autoReveal:window.PfeConfig?.autoReveal??n?!n:r("pfe-auto-reveal")==="true",get log(){return!!localStorage.pfeLog},set log(e){e?localStorage.setItem("pfeLog",`${!0}`):localStorage.removeItem("pfeLog")}});export{i as ComposedEvent,l as NumberListConverter,f as trackPerformance};
|
|
1
|
+
var o=Symbol();function r(e){return document.head.querySelector(`meta[name="${e}"]`)?.content}function f(e=o){return e!==o&&(window.PfeConfig.trackPerformance=!!e),window.PfeConfig.trackPerformance}var l={fromAttribute(e){return typeof e!="string"?null:e.split(",").map(t=>t.trim()).map(t=>parseInt(t,10))},toAttribute(e){return e.join(",")}},i=class extends Event{constructor(t,a){super(t,{bubbles:!0,composed:!0,...a})}},n=document.body.hasAttribute("no-auto-reveal");window.PfeConfig=Object.assign(window.PfeConfig??{},{trackPerformance:window.PfeConfig?.trackPerformance??r("pfe-track-performance")==="true",autoReveal:window.PfeConfig?.autoReveal??(n?!n:r("pfe-auto-reveal")==="true"),get log(){return!!localStorage.pfeLog},set log(e){e?localStorage.setItem("pfeLog",`${!0}`):localStorage.removeItem("pfeLog")}});export{i as ComposedEvent,l as NumberListConverter,f as trackPerformance};
|
|
2
2
|
//# sourceMappingURL=core.js.map
|
package/core.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["core.ts"],
|
|
4
|
-
"sourcesContent": ["import type { ComplexAttributeConverter } from 'lit';\n\n/** PatternFly Elements global config object */\nexport interface PfeConfig {\n /** Set to false to disable client-side page load performance tracking */\n trackPerformance?: boolean;\n /** Set to false to disable various debug logs */\n log?: boolean;\n /** Set to false to disable automatically removing `unresolved` attr from body */\n autoReveal?: boolean;\n}\n\nexport type ColorTheme = (\n | 'base'\n | 'accent'\n | 'complement'\n | 'lighter'\n | 'lightest'\n | 'darker'\n | 'darkest'\n);\n\nexport type ContextTheme = (\n | 'dark'\n | 'light'\n | 'saturated'\n);\n\nconst noPref = Symbol();\n\n/** Retrieve an HTML metadata item */\nfunction getMeta(name: string): string|undefined {\n return document.head.querySelector<HTMLMetaElement>(`meta[name=\"${name}\"]`)?.content;\n}\n\n/**\n * A boolean value that indicates if the performance should be tracked.\n * For use in a JS file or script tag; can also be added in the constructor of a component during development.\n * @example trackPerformance(true);\n */\nexport function trackPerformance(preference: boolean | typeof noPref = noPref) {\n if (preference !== noPref) {\n window.PfeConfig.trackPerformance = !!preference;\n }\n return window.PfeConfig.trackPerformance;\n}\n\n/**\n * A LitElement property converter which represents a list of numbers as a comma separated string\n * @see https://lit.dev/docs/components/properties/#conversion-converter\n */\nexport const NumberListConverter: ComplexAttributeConverter<null|number[]> = {\n fromAttribute(value: string) {\n if (typeof value !== 'string') {\n return null;\n } else {\n return value.split(',').map(x => x.trim()).map(x => parseInt(x, 10));\n }\n },\n toAttribute(value: number[]) {\n return value.join(',');\n },\n};\n\n/**\n * A composed, bubbling event for UI interactions\n * e.g. when an accordion panel opens.\n */\nexport class ComposedEvent extends Event {\n constructor(type: string, init?: EventInit) {\n super(type, {\n bubbles: true,\n composed: true,\n ...init\n });\n }\n}\n\n// \uD83D\uDC47 SIDE EFFECTS \uD83D\uDC47\n\ndeclare global {\n interface Window {\n /** Global configuration settings for PatternFly Elements */\n PfeConfig: PfeConfig;\n }\n}\n\nconst bodyNoAutoReveal = document.body.hasAttribute('no-auto-reveal');\n\n/** Global patternfly elements config */\nwindow.PfeConfig = Object.assign(window.PfeConfig ?? {}, {\n trackPerformance: window.PfeConfig?.trackPerformance ?? getMeta('pfe-track-performance') === 'true',\n autoReveal: window.PfeConfig?.autoReveal ?? bodyNoAutoReveal ? !bodyNoAutoReveal
|
|
5
|
-
"mappings": "AA4BA,GAAM,GAAS,OAAO,EAGtB,WAAiB,EAAgC,CAC/C,MAAO,UAAS,KAAK,cAA+B,cAAc,KAAQ,GAAG,OAC/E,CAOO,WAA0B,EAAsC,EAAQ,CAC7E,MAAI,KAAe,GACjB,QAAO,UAAU,iBAAmB,CAAC,CAAC,GAEjC,OAAO,UAAU,gBAC1B,CAMO,GAAM,GAAgE,CAC3E,cAAc,EAAe,CAC3B,MAAI,OAAO,IAAU,SACZ,KAEA,EAAM,MAAM,GAAG,EAAE,IAAI,GAAK,EAAE,KAAK,CAAC,EAAE,IAAI,GAAK,SAAS,EAAG,EAAE,CAAC,CAEvE,EACA,YAAY,EAAiB,CAC3B,MAAO,GAAM,KAAK,GAAG,CACvB,CACF,EAMO,eAA4B,MAAM,CACvC,YAAY,EAAc,EAAkB,CAC1C,MAAM,EAAM,CACV,QAAS,GACT,SAAU,MACP,CACL,CAAC,CACH,CACF,EAWM,EAAmB,SAAS,KAAK,aAAa,gBAAgB,EAGpE,OAAO,UAAY,OAAO,OAAO,OAAO,WAAa,CAAC,EAAG,CACvD,iBAAkB,OAAO,WAAW,kBAAoB,EAAQ,uBAAuB,IAAM,
|
|
4
|
+
"sourcesContent": ["import type { ComplexAttributeConverter } from 'lit';\n\n/** PatternFly Elements global config object */\nexport interface PfeConfig {\n /** Set to false to disable client-side page load performance tracking */\n trackPerformance?: boolean;\n /** Set to false to disable various debug logs */\n log?: boolean;\n /** Set to false to disable automatically removing `unresolved` attr from body */\n autoReveal?: boolean;\n}\n\nexport type ColorTheme = (\n | 'base'\n | 'accent'\n | 'complement'\n | 'lighter'\n | 'lightest'\n | 'darker'\n | 'darkest'\n);\n\nexport type ContextTheme = (\n | 'dark'\n | 'light'\n | 'saturated'\n);\n\nconst noPref = Symbol();\n\n/** Retrieve an HTML metadata item */\nfunction getMeta(name: string): string|undefined {\n return document.head.querySelector<HTMLMetaElement>(`meta[name=\"${name}\"]`)?.content;\n}\n\n/**\n * A boolean value that indicates if the performance should be tracked.\n * For use in a JS file or script tag; can also be added in the constructor of a component during development.\n * @example trackPerformance(true);\n */\nexport function trackPerformance(preference: boolean | typeof noPref = noPref) {\n if (preference !== noPref) {\n window.PfeConfig.trackPerformance = !!preference;\n }\n return window.PfeConfig.trackPerformance;\n}\n\n/**\n * A LitElement property converter which represents a list of numbers as a comma separated string\n * @see https://lit.dev/docs/components/properties/#conversion-converter\n */\nexport const NumberListConverter: ComplexAttributeConverter<null|number[]> = {\n fromAttribute(value: string) {\n if (typeof value !== 'string') {\n return null;\n } else {\n return value.split(',').map(x => x.trim()).map(x => parseInt(x, 10));\n }\n },\n toAttribute(value: number[]) {\n return value.join(',');\n },\n};\n\n/**\n * A composed, bubbling event for UI interactions\n * e.g. when an accordion panel opens.\n */\nexport class ComposedEvent extends Event {\n constructor(type: string, init?: EventInit) {\n super(type, {\n bubbles: true,\n composed: true,\n ...init\n });\n }\n}\n\n// \uD83D\uDC47 SIDE EFFECTS \uD83D\uDC47\n\ndeclare global {\n interface Window {\n /** Global configuration settings for PatternFly Elements */\n PfeConfig: PfeConfig;\n }\n}\n\nconst bodyNoAutoReveal = document.body.hasAttribute('no-auto-reveal');\n\n/** Global patternfly elements config */\nwindow.PfeConfig = Object.assign(window.PfeConfig ?? {}, {\n trackPerformance: window.PfeConfig?.trackPerformance ?? getMeta('pfe-track-performance') === 'true',\n // if the body tag has `no-auto-reveal` attribute, reveal immediately\n // if `<meta name=\"pfe-auto-reveal\">` exists, and it's `content` is 'true',\n // then auto-reveal the body\n autoReveal: window.PfeConfig?.autoReveal ?? (\n bodyNoAutoReveal ? !bodyNoAutoReveal\n : getMeta('pfe-auto-reveal') === 'true'\n ),\n get log() {\n return !!localStorage.pfeLog;\n },\n set log(v: boolean) {\n if (v) {\n localStorage.setItem('pfeLog', `${true}`);\n } else {\n localStorage.removeItem('pfeLog');\n }\n },\n});\n"],
|
|
5
|
+
"mappings": "AA4BA,GAAM,GAAS,OAAO,EAGtB,WAAiB,EAAgC,CAC/C,MAAO,UAAS,KAAK,cAA+B,cAAc,KAAQ,GAAG,OAC/E,CAOO,WAA0B,EAAsC,EAAQ,CAC7E,MAAI,KAAe,GACjB,QAAO,UAAU,iBAAmB,CAAC,CAAC,GAEjC,OAAO,UAAU,gBAC1B,CAMO,GAAM,GAAgE,CAC3E,cAAc,EAAe,CAC3B,MAAI,OAAO,IAAU,SACZ,KAEA,EAAM,MAAM,GAAG,EAAE,IAAI,GAAK,EAAE,KAAK,CAAC,EAAE,IAAI,GAAK,SAAS,EAAG,EAAE,CAAC,CAEvE,EACA,YAAY,EAAiB,CAC3B,MAAO,GAAM,KAAK,GAAG,CACvB,CACF,EAMO,eAA4B,MAAM,CACvC,YAAY,EAAc,EAAkB,CAC1C,MAAM,EAAM,CACV,QAAS,GACT,SAAU,MACP,CACL,CAAC,CACH,CACF,EAWM,EAAmB,SAAS,KAAK,aAAa,gBAAgB,EAGpE,OAAO,UAAY,OAAO,OAAO,OAAO,WAAa,CAAC,EAAG,CACvD,iBAAkB,OAAO,WAAW,kBAAoB,EAAQ,uBAAuB,IAAM,OAI7F,WAAY,OAAO,WAAW,YAC1B,GAAmB,CAAC,EACpB,EAAQ,iBAAiB,IAAM,WAE/B,MAAM,CACR,MAAO,CAAC,CAAC,aAAa,MACxB,KACI,KAAI,EAAY,CAClB,AAAI,EACF,aAAa,QAAQ,SAAU,GAAG,IAAM,EAExC,aAAa,WAAW,QAAQ,CAEpC,CACF,CAAC",
|
|
6
6
|
"names": []
|
|
7
7
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@patternfly/pfe-core",
|
|
3
|
-
"version": "2.0.0-next.
|
|
3
|
+
"version": "2.0.0-next.3",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "PatternFly Elements Core Library",
|
|
6
6
|
"customElements": "custom-elements.json",
|
|
@@ -9,98 +9,29 @@
|
|
|
9
9
|
"module": "./core.js",
|
|
10
10
|
"types": "./core.d.ts",
|
|
11
11
|
"exports": {
|
|
12
|
-
".":
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
"./
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"./
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
"./
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
"./
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
"./
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
},
|
|
36
|
-
"./controllers/css-variable-controller.js": {
|
|
37
|
-
"esbuild": "./controllers/css-variable-controller.ts",
|
|
38
|
-
"default": "./controllers/css-variable-controller.js"
|
|
39
|
-
},
|
|
40
|
-
"./controllers/light-dom-controller.js": {
|
|
41
|
-
"esbuild": "./controllers/light-dom-controller.ts",
|
|
42
|
-
"default": "./controllers/light-dom-controller.js"
|
|
43
|
-
},
|
|
44
|
-
"./controllers/logger.js": {
|
|
45
|
-
"esbuild": "./controllers/logger.ts",
|
|
46
|
-
"default": "./controllers/logger.js"
|
|
47
|
-
},
|
|
48
|
-
"./controllers/perf-controller.js": {
|
|
49
|
-
"esbuild": "./controllers/perf-controller.ts",
|
|
50
|
-
"default": "./controllers/perf-controller.js"
|
|
51
|
-
},
|
|
52
|
-
"./controllers/property-observer-controller.js": {
|
|
53
|
-
"esbuild": "./controllers/property-observer-controller.ts",
|
|
54
|
-
"default": "./controllers/property-observer-controller.js"
|
|
55
|
-
},
|
|
56
|
-
"./controllers/slot-controller.js": {
|
|
57
|
-
"esbuild": "./controllers/slot-controller.ts",
|
|
58
|
-
"default": "./controllers/slot-controller.js"
|
|
59
|
-
},
|
|
60
|
-
"./controllers/style-controller.js": {
|
|
61
|
-
"esbuild": "./controllers/style-controller.ts",
|
|
62
|
-
"default": "./controllers/style-controller.js"
|
|
63
|
-
},
|
|
64
|
-
"./decorators/bound.js": {
|
|
65
|
-
"esbuild": "./decorators/bound.ts",
|
|
66
|
-
"default": "./decorators/bound.js"
|
|
67
|
-
},
|
|
68
|
-
"./decorators/cascades.js": {
|
|
69
|
-
"esbuild": "./decorators/cascades.ts",
|
|
70
|
-
"default": "./decorators/cascades.js"
|
|
71
|
-
},
|
|
72
|
-
"./decorators/initializer.js": {
|
|
73
|
-
"esbuild": "./decorators/initializer.ts",
|
|
74
|
-
"default": "./decorators/initializer.js"
|
|
75
|
-
},
|
|
76
|
-
"./decorators/observed.js": {
|
|
77
|
-
"esbuild": "./decorators/observed.ts",
|
|
78
|
-
"default": "./decorators/observed.js"
|
|
79
|
-
},
|
|
80
|
-
"./decorators/pfelement.js": {
|
|
81
|
-
"esbuild": "./decorators/pfelement.ts",
|
|
82
|
-
"default": "./decorators/pfelement.js"
|
|
83
|
-
},
|
|
84
|
-
"./decorators/time.js": {
|
|
85
|
-
"esbuild": "./decorators/time.ts",
|
|
86
|
-
"default": "./decorators/time.js"
|
|
87
|
-
},
|
|
88
|
-
"./decorators/trace.js": {
|
|
89
|
-
"esbuild": "./decorators/trace.ts",
|
|
90
|
-
"default": "./decorators/trace.js"
|
|
91
|
-
},
|
|
92
|
-
"./functions/debounce.js": {
|
|
93
|
-
"esbuild": "./functions/debounce.ts",
|
|
94
|
-
"default": "./functions/debounce.js"
|
|
95
|
-
},
|
|
96
|
-
"./functions/deprecateCustomEvent.js": {
|
|
97
|
-
"esbuild": "./functions/deprecateCustomEvent.ts",
|
|
98
|
-
"default": "./functions/deprecateCustomEvent.js"
|
|
99
|
-
},
|
|
100
|
-
"./functions/random.js": {
|
|
101
|
-
"esbuild": "./functions/random.ts",
|
|
102
|
-
"default": "./functions/random.js"
|
|
103
|
-
}
|
|
12
|
+
".": "./core.js",
|
|
13
|
+
"./core.js": "./core.js",
|
|
14
|
+
"./context.js": "./context.js",
|
|
15
|
+
"./decorators.js": "./decorators.js",
|
|
16
|
+
"./controllers/cascade-controller.js": "./controllers/cascade-controller.js",
|
|
17
|
+
"./controllers/color-context-controller.js": "./controllers/color-context-controller.js",
|
|
18
|
+
"./controllers/css-variable-controller.js": "./controllers/css-variable-controller.js",
|
|
19
|
+
"./controllers/light-dom-controller.js": "./controllers/light-dom-controller.js",
|
|
20
|
+
"./controllers/logger.js": "./controllers/logger.js",
|
|
21
|
+
"./controllers/perf-controller.js": "./controllers/perf-controller.js",
|
|
22
|
+
"./controllers/property-observer-controller.js": "./controllers/property-observer-controller.js",
|
|
23
|
+
"./controllers/slot-controller.js": "./controllers/slot-controller.js",
|
|
24
|
+
"./controllers/style-controller.js": "./controllers/style-controller.js",
|
|
25
|
+
"./decorators/bound.js": "./decorators/bound.js",
|
|
26
|
+
"./decorators/cascades.js": "./decorators/cascades.js",
|
|
27
|
+
"./decorators/initializer.js": "./decorators/initializer.js",
|
|
28
|
+
"./decorators/observed.js": "./decorators/observed.js",
|
|
29
|
+
"./decorators/pfelement.js": "./decorators/pfelement.js",
|
|
30
|
+
"./decorators/time.js": "./decorators/time.js",
|
|
31
|
+
"./decorators/trace.js": "./decorators/trace.js",
|
|
32
|
+
"./functions/debounce.js": "./functions/debounce.js",
|
|
33
|
+
"./functions/deprecatedCustomEvent.js": "./functions/deprecatedCustomEvent.js",
|
|
34
|
+
"./functions/random.js": "./functions/random.js"
|
|
104
35
|
},
|
|
105
36
|
"publishConfig": {
|
|
106
37
|
"access": "public",
|