@acusti/styling 0.7.1 → 1.0.0-rc.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/Style.d.ts CHANGED
@@ -1,6 +1,8 @@
1
- import * as React from 'react';
1
+ import React from 'react';
2
2
  type Props = {
3
3
  children: string;
4
+ href?: string;
5
+ precedence?: string;
4
6
  };
5
- declare const Style: ({ children }: Props) => React.JSX.Element | null;
7
+ declare const Style: ({ children, href: _href, precedence }: Props) => React.JSX.Element;
6
8
  export default Style;
package/dist/Style.js CHANGED
@@ -1,45 +1,16 @@
1
- import * as React from 'react';
2
- import { getRegisteredStyles, registerStyles, unregisterStyles, updateStyles, } from './style-registry.js';
3
- const { useCallback, useEffect, useMemo, useRef, useState } = React;
4
- const Style = ({ children }) => {
1
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
2
+ import React from 'react';
3
+ import { useStyles } from './useStyles.js';
4
+ const Style = ({ children, href: _href, precedence = 'medium' }) => {
5
5
  // Minify CSS styles by replacing consecutive whitespace (including \n) with ' '
6
- const styles = useMemo(() => children.replace(/\s+/gm, ' '), [children]);
7
- const [ownerDocument, setOwnerDocument] = useState(null);
8
- const isMountedRef = useRef(false);
9
- useEffect(() => {
10
- isMountedRef.current = true;
11
- unregisterStyles({ ownerDocument: 'global', styles });
12
- }, []); // eslint-disable-line react-hooks/exhaustive-deps
13
- useEffect(() => () => {
14
- if (!ownerDocument)
15
- return;
16
- unregisterStyles({ ownerDocument, styles });
17
- }, [ownerDocument]);
18
- const previousStylesRef = useRef('');
19
- useEffect(() => {
20
- if (!ownerDocument)
21
- return;
22
- updateStyles({
23
- ownerDocument,
24
- previousStyles: previousStylesRef.current,
25
- styles,
26
- });
27
- previousStylesRef.current = styles;
28
- }, [ownerDocument, styles]);
29
- const handleRef = useCallback((element) => {
30
- if (!element)
31
- return;
32
- setOwnerDocument(element.ownerDocument);
33
- }, []);
34
- if (ownerDocument)
35
- return null;
36
- // Avoid duplicate style rendering during SSR via style registry
37
- if (!isMountedRef.current) {
38
- if (getRegisteredStyles({ ownerDocument: 'global', styles }))
39
- return null;
40
- registerStyles({ ownerDocument: 'global', styles });
41
- }
42
- return React.createElement("style", { dangerouslySetInnerHTML: { __html: styles }, ref: handleRef });
6
+ const { href, styles } = useStyles(children, _href);
7
+ // https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/types/react/canary.d.ts
8
+ // https://react.dev/reference/react-dom/components/style#props
9
+ return (
10
+ // @ts-expect-error @types/react is missing new <style> props
11
+ // eslint-disable-next-line react/no-unknown-property
12
+ React.createElement('style', { href: href, precedence: precedence }, styles)
13
+ );
43
14
  };
44
15
  export default Style;
45
- //# sourceMappingURL=Style.js.map
16
+ //# sourceMappingURL=Style.js.map
@@ -5,9 +5,11 @@
5
5
  * @flow
6
6
  */
7
7
 
8
- import * as React from "react";
8
+ import React from "react";
9
9
  declare type Props = {|
10
10
  children: string,
11
+ href?: string,
12
+ precedence?: string,
11
13
  |};
12
- declare var Style: (x: Props) => React.JSX.Element | null;
14
+ declare var Style: (x: Props) => React.Node;
13
15
  declare export default typeof Style;
package/dist/Style.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"Style.js","sourceRoot":"","sources":["../src/Style.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,EACH,mBAAmB,EACnB,cAAc,EACd,gBAAgB,EAChB,YAAY,GACf,MAAM,qBAAqB,CAAC;AAE7B,MAAM,EAAE,WAAW,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,KAAK,CAAC;AAMpE,MAAM,KAAK,GAAG,CAAC,EAAE,QAAQ,EAAS,EAAE,EAAE;IAClC,gFAAgF;IAChF,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC,QAAQ,CAAC,OAAO,CAAC,OAAO,EAAE,GAAG,CAAC,EAAE,CAAC,QAAQ,CA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AE,CAAC;YAAE,OAAO,IAAI,CAAC;QAC1E,cAAc,CAAC,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,EAAE,CAAC,CAAC;IACxD,CAAC;IAED,OAAO,+BAAO,uBAAuB,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,GAAG,EAAE,SAAS,GAAI,CAAC;AAClF,CAAC,CAAC;AAEF,eAAe,KAAK,CAAC"}
1
+ {"version":3,"file":"Style.js","sourceRoot":"","sources":["../src/Style.tsx"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAQ3C,MAAM,KAAK,GAAG,CAAC,EAAE,QAAQ,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,GAAG,QAAQ,EAAS,EAAE,EAAE;IACtE,gFAAgF;IAChF,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;IACpD,yFAAyF;IACzF,+DAA+D;IAC/D,OAAO;IACH,6DAA6D;IAC7D,qDAAqD;IACrD,+BAAO,IAAI,EAAE,IAAI,EAAE,UAAU,EAAE,UAAU,IACpC,MAAM,CACH,CACX,CAAC;AACN,CAAC,CAAC;AAEF,eAAe,KAAK,CAAC"}
package/dist/index.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export { default as Style } from './Style.js';
2
- export declare const SYSTEM_UI_FONT = "-apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, Oxygen-Sans, Ubuntu, Cantarell, \"Helvetica Neue\", sans-serif";
2
+ export declare const SYSTEM_UI_FONT =
3
+ '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif';
package/dist/index.js CHANGED
@@ -1,3 +1,5 @@
1
+ /// <reference types="react/canary" />
1
2
  export { default as Style } from './Style.js';
2
- export const SYSTEM_UI_FONT = '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif';
3
- //# sourceMappingURL=index.js.map
3
+ export const SYSTEM_UI_FONT =
4
+ '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif';
5
+ //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,YAAY,CAAC;AAE9C,MAAM,CAAC,MAAM,cAAc,GACvB,qHAAqH,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,sCAAsC;AACtC,OAAO,EAAE,OAAO,IAAI,KAAK,EAAE,MAAM,YAAY,CAAC;AAE9C,MAAM,CAAC,MAAM,cAAc,GACvB,qHAAqH,CAAC"}
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Adapted from:
3
+ * https://github.com/jbleuzen/node-cssmin/blob/master/cssmin.js
4
+ * node-cssmin
5
+ * A simple module for Node.js that minify CSS
6
+ * Author : Johan Bleuzen
7
+ */
8
+ /**
9
+ * cssmin.js
10
+ * Author: Stoyan Stefanov - http://phpied.com/
11
+ * This is a JavaScript port of the CSS minification tool
12
+ * distributed with YUICompressor, itself a port
13
+ * of the cssmin utility by Isaac Schlueter - http://foohack.com/
14
+ * Permission is hereby granted to use the JavaScript version under the same
15
+ * conditions as the YUICompressor (original YUICompressor note below).
16
+ */
17
+ export declare function minifyStyles(css: string): string;
18
+ export default minifyStyles;
@@ -0,0 +1,151 @@
1
+ /**
2
+ * Adapted from:
3
+ * https://github.com/jbleuzen/node-cssmin/blob/master/cssmin.js
4
+ * node-cssmin
5
+ * A simple module for Node.js that minify CSS
6
+ * Author : Johan Bleuzen
7
+ */
8
+ /**
9
+ * cssmin.js
10
+ * Author: Stoyan Stefanov - http://phpied.com/
11
+ * This is a JavaScript port of the CSS minification tool
12
+ * distributed with YUICompressor, itself a port
13
+ * of the cssmin utility by Isaac Schlueter - http://foohack.com/
14
+ * Permission is hereby granted to use the JavaScript version under the same
15
+ * conditions as the YUICompressor (original YUICompressor note below).
16
+ */
17
+ /*
18
+ * YUI Compressor
19
+ * http://developer.yahoo.com/yui/compressor/
20
+ * Author: Julien Lecomte - http://www.julienlecomte.net/
21
+ * Copyright (c) 2011 Yahoo! Inc. All rights reserved.
22
+ * The copyrights embodied in the content of this file are licensed
23
+ * by Yahoo! Inc. under the BSD (revised) open source license.
24
+ */
25
+ export function minifyStyles(css) {
26
+ const preservedTokens = [];
27
+ const comments = [];
28
+ const totalLength = css.length;
29
+ let startIndex = 0,
30
+ endIndex = 0,
31
+ i = 0,
32
+ max = 0,
33
+ token = '',
34
+ placeholder = '';
35
+ // collect all comment blocks...
36
+ while ((startIndex = css.indexOf('/*', startIndex)) >= 0) {
37
+ endIndex = css.indexOf('*/', startIndex + 2);
38
+ if (endIndex < 0) {
39
+ endIndex = totalLength;
40
+ }
41
+ token = css.slice(startIndex + 2, endIndex);
42
+ comments.push(token);
43
+ css =
44
+ css.slice(0, startIndex + 2) +
45
+ '___PRESERVE_CANDIDATE_COMMENT_' +
46
+ (comments.length - 1) +
47
+ '___' +
48
+ css.slice(endIndex);
49
+ startIndex += 2;
50
+ }
51
+ // preserve strings so their content doesn't get accidentally minified
52
+ css = css.replace(/("([^\\"]|\\.|\\)*")|('([^\\']|\\.|\\)*')/g, function (match) {
53
+ const quote = match.substring(0, 1);
54
+ let i, max;
55
+ match = match.slice(1, -1);
56
+ // maybe the string contains a comment-like substring?
57
+ // one, maybe more? put'em back then
58
+ if (match.indexOf('___PRESERVE_CANDIDATE_COMMENT_') >= 0) {
59
+ for (i = 0, max = comments.length; i < max; i = i + 1) {
60
+ match = match.replace(
61
+ '___PRESERVE_CANDIDATE_COMMENT_' + i + '___',
62
+ comments[i],
63
+ );
64
+ }
65
+ }
66
+ preservedTokens.push(match);
67
+ return (
68
+ quote + '___PRESERVED_TOKEN_' + (preservedTokens.length - 1) + '___' + quote
69
+ );
70
+ });
71
+ // strings are safe, now wrestle the comments
72
+ for (i = 0, max = comments.length; i < max; i = i + 1) {
73
+ token = comments[i];
74
+ placeholder = '___PRESERVE_CANDIDATE_COMMENT_' + i + '___';
75
+ // ! in the first position of the comment means preserve
76
+ // so push to the preserved tokens keeping the !
77
+ if (token.charAt(0) === '!') {
78
+ preservedTokens.push(token);
79
+ css = css.replace(
80
+ placeholder,
81
+ '___PRESERVED_TOKEN_' + (preservedTokens.length - 1) + '___',
82
+ );
83
+ continue;
84
+ }
85
+ // otherwise, kill the comment
86
+ css = css.replace('/*' + placeholder + '*/', '');
87
+ }
88
+ // Normalize all whitespace strings to single spaces. Easier to work with that way.
89
+ css = css.replace(/\s+/g, ' ');
90
+ // Remove the spaces before the things that should not have spaces before them.
91
+ // But, be careful not to turn "p :link {...}" into "p:link{...}"
92
+ // Swap out any pseudo-class colons with the token, and then swap back.
93
+ css = css.replace(/(^|\})(([^{:])+:)+([^{]*\{)/g, function (m) {
94
+ return m.replace(/:/g, '___PSEUDOCLASSCOLON___');
95
+ });
96
+ // Preserve spaces in calc expressions
97
+ css = css.replace(/calc\s*\(\s*(.*?)\s*\)/g, function (m, c) {
98
+ return m.replace(c, c.replace(/\s+/g, '___SPACE_IN_CALC___'));
99
+ });
100
+ css = css.replace(/\s+([!{};:>+()\],])/g, '$1');
101
+ css = css.replace(/___PSEUDOCLASSCOLON___/g, ':');
102
+ // no space after the end of a preserved comment
103
+ css = css.replace(/\*\/ /g, '*/');
104
+ // If there is a @charset, then only allow one, and push to the top of the file.
105
+ css = css.replace(/^(.*)(@charset "[^"]*";)/gi, '$2$1');
106
+ css = css.replace(/^(\s*@charset [^;]+;\s*)+/gi, '$1');
107
+ // Put the space back in some cases, to support stuff like
108
+ // @media screen and (-webkit-min-device-pixel-ratio:0){
109
+ css = css.replace(/\band\(/gi, 'and (');
110
+ // Remove the spaces after the things that should not have spaces after them.
111
+ css = css.replace(/([!{}:;>+([,])\s+/g, '$1');
112
+ // Restore preserved spaces in calc expressions
113
+ css = css.replace(/___SPACE_IN_CALC___/g, ' ');
114
+ // remove unnecessary semicolons
115
+ css = css.replace(/;+\}/g, '}');
116
+ // Replace 0(px,em,%) with 0.
117
+ css = css.replace(/([\s:])(0)(px|em|%|in|cm|mm|pc|pt|ex)/gi, '$1$2');
118
+ // Replace 0 0 0 0; with 0.
119
+ css = css.replace(/:0 0 0 0(;|\})/g, ':0$1');
120
+ css = css.replace(/:0 0 0(;|\})/g, ':0$1');
121
+ css = css.replace(/:0 0(;|\})/g, ':0$1');
122
+ // Replace background-position:0; with background-position:0 0;
123
+ // same for transform-origin
124
+ css = css.replace(
125
+ /(background-position|transform-origin):0(;|\})/gi,
126
+ function (_all, prop, tail) {
127
+ return prop.toLowerCase() + ':0 0' + tail;
128
+ },
129
+ );
130
+ // Replace 0.6 to .6, but only when preceded by : or a white-space
131
+ css = css.replace(/(:|\s)0+\.(\d+)/g, '$1.$2');
132
+ // border: none -> border:0
133
+ css = css.replace(
134
+ /(border|border-top|border-right|border-bottom|border-right|outline|background):none(;|\})/gi,
135
+ function (_all, prop, tail) {
136
+ return prop.toLowerCase() + ':0' + tail;
137
+ },
138
+ );
139
+ // Remove empty rules.
140
+ css = css.replace(/[^};{/]+\{\}/g, '');
141
+ // Replace multiple semi-colons in a row by a single one
142
+ // See SF bug #1980989
143
+ css = css.replace(/;;+/g, ';');
144
+ // restore preserved comments and strings
145
+ for (i = 0, max = preservedTokens.length; i < max; i = i + 1) {
146
+ css = css.replace('___PRESERVED_TOKEN_' + i + '___', preservedTokens[i]);
147
+ }
148
+ return css.trim();
149
+ }
150
+ export default minifyStyles;
151
+ //# sourceMappingURL=minifyStyles.js.map
@@ -0,0 +1,25 @@
1
+ /**
2
+ * Flowtype definitions for minifyStyles
3
+ * Generated by Flowgen from a Typescript Definition
4
+ * Flowgen v1.20.1
5
+ * @flow
6
+ */
7
+
8
+ /**
9
+ * Adapted from:
10
+ * https://github.com/jbleuzen/node-cssmin/blob/master/cssmin.js
11
+ * node-cssmin
12
+ * A simple module for Node.js that minify CSS
13
+ * Author : Johan Bleuzen
14
+ */
15
+ /**
16
+ * cssmin.js
17
+ * Author: Stoyan Stefanov - http://phpied.com/
18
+ * This is a JavaScript port of the CSS minification tool
19
+ * distributed with YUICompressor, itself a port
20
+ * of the cssmin utility by Isaac Schlueter - http://foohack.com/
21
+ * Permission is hereby granted to use the JavaScript version under the same
22
+ * conditions as the YUICompressor (original YUICompressor note below).
23
+ */
24
+ declare export function minifyStyles(css: string): string;
25
+ declare export default typeof minifyStyles;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"minifyStyles.js","sourceRoot":"","sources":["../src/minifyStyles.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;;GAQG;AAEH;;;;;;;GAOG;AAEH,MAAM,UAAU,YAAY,CAAC,GAAW;IACpC,MAAM,eAAe,GAAkB,EAAE,CAAC;IAC1C,MAAM,QAAQ,GAAkB,EAAE,CAAC;IACnC,MAAM,WAAW,GAAG,GAAG,CAAC,MAAM,CAAC;IAC/B,IAAI,UAAU,GAAG,CAAC,EACd,QAAQ,GAAG,CAAC,EACZ,CAAC,GAAG,CAAC,EACL,GAAG,GAAG,CAAC,EACP,KAAK,GAAG,EAAE,EACV,WAAW,GAAG,EAAE,CAAC;IAErB,gCAAgC;IAChC,OAAO,CAAC,UAAU,GAAG,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC;QACvD,QAAQ,GAAG,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE,UAAU,GAAG,CAAC,CAAC,CAAC;QAC7C,IAAI,QAAQ,GAAG,CAAC,EAAE,CAAC;YACf,QAAQ,GAAG,WAA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AAY;QACtC,OAAO,IAAI,CAAC,WAAW,EAAE,GAAG,MAAM,GAAG,IAAI,CAAC;IAC9C,CAAC,CACJ,CAAC;IAEF,kEAAkE;IAClE,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,kBAAkB,EAAE,OAAO,CAAC,CAAC;IAE/C,2BAA2B;IAC3B,GAAG,GAAG,GAAG,CAAC,OAAO,CACb,6FAA6F,EAC7F,UAAU,IAAI,EAAE,IAAY,EAAE,IAAY;QACtC,OAAO,IAAI,CAAC,WAAW,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;IAC5C,CAAC,CACJ,CAAC;IAEF,sBAAsB;IACtB,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,eAAe,EAAE,EAAE,CAAC,CAAC;IAEvC,wDAAwD;IACxD,sBAAsB;IACtB,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAE/B,yCAAyC;IACzC,KAAK,CAAC,GAAG,CAAC,EAAE,GAAG,GAAG,eAAe,CAAC,MAAM,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC;QAC3D,GAAG,GAAG,GAAG,CAAC,OAAO,CAAC,qBAAqB,GAAG,CAAC,GAAG,KAAK,EAAE,eAAe,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7E,CAAC;IAED,OAAO,GAAG,CAAC,IAAI,EAAE,CAAC;AACtB,CAAC;AAED,eAAe,YAAY,CAAC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,32 @@
1
+ import { describe, expect, it } from 'vitest';
2
+ import { minifyStyles } from './minifyStyles.js';
3
+ describe('@acusti/styling', () => {
4
+ describe('minifyStyles.ts', () => {
5
+ it('minifies basic CSS declarations', () => {
6
+ expect(
7
+ minifyStyles(`
8
+ .foo {
9
+ padding: 10px;
10
+ color: red;
11
+ }`),
12
+ ).toBe('.foo{padding:10px;color:red}');
13
+ });
14
+ it('preserves whitespace where needed in selectors', () => {
15
+ expect(
16
+ minifyStyles(`
17
+ .foo > .bar :hover {
18
+ background-color: cyan;
19
+ }`),
20
+ ).toBe('.foo>.bar :hover{background-color:cyan}');
21
+ });
22
+ it('minifies 0.6 to .6, but only when preceded by : or a whitespace', () => {
23
+ expect(
24
+ minifyStyles(`
25
+ .foo {
26
+ opacity: 0.6;
27
+ }`),
28
+ ).toBe('.foo{opacity:.6}');
29
+ });
30
+ });
31
+ });
32
+ //# sourceMappingURL=minifyStyles.test.js.map
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Flowtype definitions for minifyStyles.test
3
+ * Generated by Flowgen from a Typescript Definition
4
+ * Flowgen v1.20.1
5
+ * @flow
6
+ */
@@ -0,0 +1 @@
1
+ {"version":3,"file":"minifyStyles.test.js","sourceRoot":"","sources":["../src/minifyStyles.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE9C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEjD,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;IAC7B,QAAQ,CAAC,iBAAiB,EAAE,GAAG,EAAE;QAC7B,EAAE,CAAC,iCAAiC,EAAE,GAAG,EAAE;YACvC,MAAM,CACF,YAAY,CAAC;;;;EAI3B,CAAC,CACU,CAAC,IAAI,CAAC,8BAA8B,CAAC,CAAC;QAC3C,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,gDAAgD,EAAE,GAAG,EAAE;YACtD,MAAM,CACF,YAAY,CAAC;;;EAG3B,CAAC,CACU,CAAC,IAAI,CAAC,yCAAyC,CAAC,CAAC;QACtD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,iEAAiE,EAAE,GAAG,EAAE;YACvE,MAAM,CACF,YAAY,CAAC;;;EAG3B,CAAC,CACU,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAC;QAC/B,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}
@@ -13,7 +13,11 @@ type UpdatePayload = {
13
13
  previousStyles: string;
14
14
  styles: string;
15
15
  };
16
- export declare const updateStyles: ({ ownerDocument, previousStyles, styles, }: UpdatePayload) => void;
16
+ export declare const updateStyles: ({
17
+ ownerDocument,
18
+ previousStyles,
19
+ styles,
20
+ }: UpdatePayload) => void;
17
21
  export declare const getStyleRegistryKeys: () => IterableIterator<string>;
18
22
  export declare const clearRegistry: () => void;
19
23
  export {};
@@ -1,18 +1,15 @@
1
1
  const styleRegistry = new Map();
2
2
  export const getRegisteredStyles = ({ ownerDocument, styles }) => {
3
3
  var _a;
4
- if (!styles)
5
- return null;
4
+ if (!styles) return null;
6
5
  const stylesMap = styleRegistry.get(styles);
7
- if (!stylesMap)
8
- return null;
6
+ if (!stylesMap) return null;
9
7
  return (_a = stylesMap.get(ownerDocument)) !== null && _a !== void 0 ? _a : null;
10
8
  };
11
9
  // NOTE a more idiomatic API than (register|unregister)Styles would be
12
10
  // to make registerStyles a thunk that returns a cleanup function
13
11
  export const registerStyles = ({ ownerDocument, styles }) => {
14
- if (!styles)
15
- return;
12
+ if (!styles) return;
16
13
  const existingStylesItem = getRegisteredStyles({ ownerDocument, styles });
17
14
  if (existingStylesItem) {
18
15
  existingStylesItem.referenceCount++;
@@ -23,8 +20,7 @@ export const registerStyles = ({ ownerDocument, styles }) => {
23
20
  let stylesMap = styleRegistry.get(styles);
24
21
  if (stylesMap) {
25
22
  stylesMap.set(ownerDocument, stylesItem);
26
- }
27
- else {
23
+ } else {
28
24
  stylesMap = new Map([[ownerDocument, stylesItem]]);
29
25
  }
30
26
  styleRegistry.set(styles, stylesMap);
@@ -43,14 +39,11 @@ export const registerStyles = ({ ownerDocument, styles }) => {
43
39
  styleRegistry.set(styles, new Map([[ownerDocument, stylesItem]]));
44
40
  };
45
41
  export const unregisterStyles = ({ ownerDocument, styles }) => {
46
- if (!styles)
47
- return;
42
+ if (!styles) return;
48
43
  const stylesItem = getRegisteredStyles({ ownerDocument, styles });
49
- if (!stylesItem)
50
- return;
44
+ if (!stylesItem) return;
51
45
  stylesItem.referenceCount--;
52
- if (stylesItem.referenceCount)
53
- return;
46
+ if (stylesItem.referenceCount) return;
54
47
  // If no more references to these styles in this document, remove <style> element from the DOM
55
48
  if (stylesItem.element) {
56
49
  const { parentElement } = stylesItem.element;
@@ -61,17 +54,24 @@ export const unregisterStyles = ({ ownerDocument, styles }) => {
61
54
  // Then remove the document Map
62
55
  const stylesMap = styleRegistry.get(styles);
63
56
  stylesMap.delete(ownerDocument);
64
- if (stylesMap.size)
65
- return;
57
+ if (stylesMap.size) return;
66
58
  // If no more references to these styles in any document, remove it entirely
67
59
  styleRegistry.delete(styles);
68
60
  };
69
- export const updateStyles = ({ ownerDocument, previousStyles, styles, }) => {
70
- if (previousStyles === styles)
71
- return;
61
+ export const updateStyles = ({ ownerDocument, previousStyles, styles }) => {
62
+ if (previousStyles === styles) return;
72
63
  const stylesMap = styleRegistry.get(previousStyles);
73
- const stylesItem = stylesMap === null || stylesMap === void 0 ? void 0 : stylesMap.get(ownerDocument);
74
- if (stylesMap && (stylesItem === null || stylesItem === void 0 ? void 0 : stylesItem.element) && (stylesItem === null || stylesItem === void 0 ? void 0 : stylesItem.referenceCount) === 1) {
64
+ const stylesItem =
65
+ stylesMap === null || stylesMap === void 0
66
+ ? void 0
67
+ : stylesMap.get(ownerDocument);
68
+ if (
69
+ stylesMap &&
70
+ (stylesItem === null || stylesItem === void 0 ? void 0 : stylesItem.element) &&
71
+ (stylesItem === null || stylesItem === void 0
72
+ ? void 0
73
+ : stylesItem.referenceCount) === 1
74
+ ) {
75
75
  // Mutate existing <style> element with updated styles
76
76
  stylesItem.element.innerHTML = styles;
77
77
  styleRegistry.set(styles, new Map([[ownerDocument, stylesItem]]));
@@ -91,4 +91,4 @@ export const getStyleRegistryKeys = () => styleRegistry.keys();
91
91
  export const clearRegistry = () => {
92
92
  styleRegistry.clear();
93
93
  };
94
- //# sourceMappingURL=style-registry.js.map
94
+ //# sourceMappingURL=style-registry.js.map
@@ -1,6 +1,13 @@
1
1
  // @vitest-environment happy-dom
2
2
  import { beforeEach, describe, expect, it } from 'vitest';
3
- import { clearRegistry, getRegisteredStyles, getStyleRegistryKeys, registerStyles, unregisterStyles, updateStyles, } from './style-registry.js';
3
+ import {
4
+ clearRegistry,
5
+ getRegisteredStyles,
6
+ getStyleRegistryKeys,
7
+ registerStyles,
8
+ unregisterStyles,
9
+ updateStyles,
10
+ } from './style-registry.js';
4
11
  describe('@acusti/styling', () => {
5
12
  describe('style-registry.ts', () => {
6
13
  const mockStyles = '.test { color: red; }';
@@ -111,4 +118,4 @@ describe('@acusti/styling', () => {
111
118
  });
112
119
  });
113
120
  });
114
- //# sourceMappingURL=style-registry.test.js.map
121
+ //# sourceMappingURL=style-registry.test.js.map
@@ -0,0 +1,19 @@
1
+ type StyleRegistry = Map<
2
+ string,
3
+ {
4
+ href: string;
5
+ referenceCount: number;
6
+ styles: string;
7
+ }
8
+ >;
9
+ export declare const getStyleRegistry: () => StyleRegistry;
10
+ export declare function useStyles(
11
+ styles: string,
12
+ initialHref?: string,
13
+ ): {
14
+ href: string;
15
+ referenceCount: number;
16
+ styles: string;
17
+ };
18
+ export default useStyles;
19
+ export declare const clearRegistry: () => void;
@@ -0,0 +1,69 @@
1
+ import { useEffect, useState } from 'react';
2
+ import { minifyStyles } from './minifyStyles.js';
3
+ const styleRegistry = new Map();
4
+ export const getStyleRegistry = () => styleRegistry;
5
+ export function useStyles(styles, initialHref) {
6
+ const [stylesItem, setStylesItem] = useState(() => {
7
+ if (!styles) return { href: '', referenceCount: 0, styles: '' };
8
+ const key = initialHref !== null && initialHref !== void 0 ? initialHref : styles;
9
+ let item = styleRegistry.get(key);
10
+ if (item) {
11
+ item.referenceCount++;
12
+ } else {
13
+ const minified = minifyStyles(styles);
14
+ item = {
15
+ href: sanitizeHref(
16
+ initialHref !== null && initialHref !== void 0
17
+ ? initialHref
18
+ : minified,
19
+ ),
20
+ referenceCount: 1,
21
+ styles: minified,
22
+ };
23
+ styleRegistry.set(key, item);
24
+ }
25
+ return item;
26
+ });
27
+ useEffect(() => {
28
+ if (!styles) return;
29
+ const key = initialHref !== null && initialHref !== void 0 ? initialHref : styles;
30
+ if (!styleRegistry.get(key)) {
31
+ const minified = minifyStyles(styles);
32
+ const item = {
33
+ href: sanitizeHref(
34
+ initialHref !== null && initialHref !== void 0
35
+ ? initialHref
36
+ : minified,
37
+ ),
38
+ referenceCount: 1,
39
+ styles: minified,
40
+ };
41
+ styleRegistry.set(key, item);
42
+ setStylesItem(item);
43
+ }
44
+ return () => {
45
+ const existingItem = styleRegistry.get(styles);
46
+ if (existingItem) {
47
+ existingItem.referenceCount--;
48
+ if (!existingItem.referenceCount) {
49
+ // TODO try scheduling this via setTimeout
50
+ // and add another referenceCount check
51
+ // to deal with instance where existing <Style>
52
+ // component is moved in the tree or re-keyed
53
+ styleRegistry.delete(styles);
54
+ }
55
+ }
56
+ };
57
+ }, [initialHref, styles]);
58
+ return stylesItem;
59
+ }
60
+ export default useStyles;
61
+ export const clearRegistry = () => {
62
+ styleRegistry.clear();
63
+ };
64
+ // Dashes in selectors in href prop create happy-dom / jsdom test errors:
65
+ // Invalid regular expression (“Range out of order in character class”)
66
+ function sanitizeHref(text) {
67
+ return text.replace(/-/g, '');
68
+ }
69
+ //# sourceMappingURL=useStyles.js.map
@@ -0,0 +1,26 @@
1
+ /**
2
+ * Flowtype definitions for useStyles
3
+ * Generated by Flowgen from a Typescript Definition
4
+ * Flowgen v1.20.1
5
+ * @flow
6
+ */
7
+
8
+ declare type StyleRegistry = Map<
9
+ string,
10
+ {|
11
+ href: string,
12
+ referenceCount: number,
13
+ styles: string,
14
+ |}
15
+ >;
16
+ declare export var getStyleRegistry: () => StyleRegistry;
17
+ declare export function useStyles(
18
+ styles: string,
19
+ initialHref?: string
20
+ ): {|
21
+ href: string,
22
+ referenceCount: number,
23
+ styles: string,
24
+ |};
25
+ declare export default typeof useStyles;
26
+ declare export var clearRegistry: () => void;
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useStyles.js","sourceRoot":"","sources":["../src/useStyles.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAE5C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAOjD,MAAM,aAAa,GAAkB,IAAI,GAAG,EAAE,CAAC;AAE/C,MAAM,CAAC,MAAM,gBAAgB,GAAG,GAAG,EAAE,CAAC,aAAa,CAAC;AAEpD,MAAM,UAAU,SAAS,CAAC,MAAc,EAAE,WAAoB;IAC1D,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,GAAG,EAAE;QAC9C,IAAI,CAAC,MAAM;YAAE,OAAO,EAAE,IAAI,EAAE,EAAE,EAAE,cAAc,EAAE,CAAC,EAAE,MAAM,EAAE,EAAE,EAAE,CAAC;QAEhE,MAAM,GAAG,GAAG,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,MAAM,CAAC;QAClC,IAAI,IAAI,GAAG,aAAa,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QAElC,IAAI,IAAI,EAAE,CAAC;YACP,IAAI,CAAC,cAAc,EAAE,CAAC;QAC1B,CAAC;aAAM,CAAC;YACJ,MAAM,QAAQ,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC;YACtC,IAAI,GAAG;gBACH,IAAI,EAAE,YAAY,CAAC,WAAW,aAAX,WAAW,cAAX,WAAW,GAAI,QAAQ,CAAC;gBAC3C,cAAc,EAAE,CAAC;gBACjB,MAAM,EAAE,QAAQ;aACnB,CAAC;YACF,aAAa,CAAC,GAAG,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;QACjC,CAAC;QAED,OAAO,IAAI,CAAC;IAChB,CAAC,CAAC,CAAC;IAEH,SAAS,CAAC,GAAG,EAAE;QACX,IAAI,CA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