@obsfx/trekker 0.1.6 → 0.1.7

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.
Files changed (146) hide show
  1. package/package.json +1 -1
  2. package/webapp-dist/.next/BUILD_ID +1 -1
  3. package/webapp-dist/.next/build-manifest.json +2 -2
  4. package/webapp-dist/.next/prerender-manifest.json +3 -3
  5. package/webapp-dist/.next/server/app/_global-error.html +2 -2
  6. package/webapp-dist/.next/server/app/_global-error.rsc +1 -1
  7. package/webapp-dist/.next/server/app/_global-error.segments/__PAGE__.segment.rsc +1 -1
  8. package/webapp-dist/.next/server/app/_global-error.segments/_full.segment.rsc +1 -1
  9. package/webapp-dist/.next/server/app/_global-error.segments/_head.segment.rsc +1 -1
  10. package/webapp-dist/.next/server/app/_global-error.segments/_index.segment.rsc +1 -1
  11. package/webapp-dist/.next/server/app/_global-error.segments/_tree.segment.rsc +1 -1
  12. package/webapp-dist/.next/server/app/_not-found.html +2 -2
  13. package/webapp-dist/.next/server/app/_not-found.rsc +1 -1
  14. package/webapp-dist/.next/server/app/_not-found.segments/_full.segment.rsc +1 -1
  15. package/webapp-dist/.next/server/app/_not-found.segments/_head.segment.rsc +1 -1
  16. package/webapp-dist/.next/server/app/_not-found.segments/_index.segment.rsc +1 -1
  17. package/webapp-dist/.next/server/app/_not-found.segments/_not-found/__PAGE__.segment.rsc +1 -1
  18. package/webapp-dist/.next/server/app/_not-found.segments/_not-found.segment.rsc +1 -1
  19. package/webapp-dist/.next/server/app/_not-found.segments/_tree.segment.rsc +1 -1
  20. package/webapp-dist/.next/server/app/index.html +2 -2
  21. package/webapp-dist/.next/server/app/index.rsc +1 -1
  22. package/webapp-dist/.next/server/app/index.segments/__PAGE__.segment.rsc +1 -1
  23. package/webapp-dist/.next/server/app/index.segments/_full.segment.rsc +1 -1
  24. package/webapp-dist/.next/server/app/index.segments/_head.segment.rsc +1 -1
  25. package/webapp-dist/.next/server/app/index.segments/_index.segment.rsc +1 -1
  26. package/webapp-dist/.next/server/app/index.segments/_tree.segment.rsc +1 -1
  27. package/webapp-dist/.next/server/pages/404.html +2 -2
  28. package/webapp-dist/.next/server/pages/500.html +2 -2
  29. package/webapp-dist/.next/server/server-reference-manifest.js +1 -1
  30. package/webapp-dist/.next/server/server-reference-manifest.json +1 -1
  31. package/webapp-dist/node_modules/@next/env/dist/index.js +1 -0
  32. package/webapp-dist/node_modules/@next/env/package.json +36 -0
  33. package/webapp-dist/node_modules/buffer-from/index.js +72 -0
  34. package/webapp-dist/node_modules/buffer-from/package.json +19 -0
  35. package/webapp-dist/node_modules/client-only/index.js +0 -0
  36. package/webapp-dist/node_modules/client-only/package.json +19 -0
  37. package/webapp-dist/node_modules/detect-libc/lib/detect-libc.js +313 -0
  38. package/webapp-dist/node_modules/detect-libc/lib/elf.js +39 -0
  39. package/webapp-dist/node_modules/detect-libc/lib/filesystem.js +51 -0
  40. package/webapp-dist/node_modules/detect-libc/lib/process.js +24 -0
  41. package/webapp-dist/node_modules/detect-libc/package.json +44 -0
  42. package/webapp-dist/node_modules/react/cjs/react-jsx-dev-runtime.production.min.js +10 -0
  43. package/webapp-dist/node_modules/react/cjs/react-jsx-runtime.production.min.js +11 -0
  44. package/webapp-dist/node_modules/react/cjs/react.production.min.js +26 -0
  45. package/webapp-dist/node_modules/react/index.js +7 -0
  46. package/webapp-dist/node_modules/react/jsx-dev-runtime.js +7 -0
  47. package/webapp-dist/node_modules/react/jsx-runtime.js +7 -0
  48. package/webapp-dist/node_modules/react/package.json +47 -0
  49. package/webapp-dist/node_modules/react-dom/cjs/react-dom-server-legacy.browser.production.min.js +93 -0
  50. package/webapp-dist/node_modules/react-dom/cjs/react-dom-server-legacy.node.production.min.js +101 -0
  51. package/webapp-dist/node_modules/react-dom/cjs/react-dom-server.browser.production.min.js +96 -0
  52. package/webapp-dist/node_modules/react-dom/cjs/react-dom-server.node.production.min.js +102 -0
  53. package/webapp-dist/node_modules/react-dom/cjs/react-dom.production.min.js +322 -0
  54. package/webapp-dist/node_modules/react-dom/index.js +38 -0
  55. package/webapp-dist/node_modules/react-dom/package.json +62 -0
  56. package/webapp-dist/node_modules/react-dom/server.browser.js +17 -0
  57. package/webapp-dist/node_modules/react-dom/server.node.js +17 -0
  58. package/webapp-dist/node_modules/scheduler/cjs/scheduler.development.js +634 -0
  59. package/webapp-dist/node_modules/scheduler/cjs/scheduler.production.min.js +19 -0
  60. package/webapp-dist/node_modules/scheduler/index.js +7 -0
  61. package/webapp-dist/node_modules/scheduler/package.json +36 -0
  62. package/webapp-dist/node_modules/semver/classes/comparator.js +143 -0
  63. package/webapp-dist/node_modules/semver/classes/range.js +557 -0
  64. package/webapp-dist/node_modules/semver/classes/semver.js +333 -0
  65. package/webapp-dist/node_modules/semver/functions/cmp.js +54 -0
  66. package/webapp-dist/node_modules/semver/functions/coerce.js +62 -0
  67. package/webapp-dist/node_modules/semver/functions/compare.js +7 -0
  68. package/webapp-dist/node_modules/semver/functions/eq.js +5 -0
  69. package/webapp-dist/node_modules/semver/functions/gt.js +5 -0
  70. package/webapp-dist/node_modules/semver/functions/gte.js +5 -0
  71. package/webapp-dist/node_modules/semver/functions/lt.js +5 -0
  72. package/webapp-dist/node_modules/semver/functions/lte.js +5 -0
  73. package/webapp-dist/node_modules/semver/functions/neq.js +5 -0
  74. package/webapp-dist/node_modules/semver/functions/parse.js +18 -0
  75. package/webapp-dist/node_modules/semver/functions/satisfies.js +12 -0
  76. package/webapp-dist/node_modules/semver/internal/constants.js +37 -0
  77. package/webapp-dist/node_modules/semver/internal/debug.js +11 -0
  78. package/webapp-dist/node_modules/semver/internal/identifiers.js +29 -0
  79. package/webapp-dist/node_modules/semver/internal/lrucache.js +42 -0
  80. package/webapp-dist/node_modules/semver/internal/parse-options.js +17 -0
  81. package/webapp-dist/node_modules/semver/internal/re.js +223 -0
  82. package/webapp-dist/node_modules/semver/package.json +78 -0
  83. package/webapp-dist/node_modules/sharp/lib/channel.js +177 -0
  84. package/webapp-dist/node_modules/sharp/lib/colour.js +195 -0
  85. package/webapp-dist/node_modules/sharp/lib/composite.js +212 -0
  86. package/webapp-dist/node_modules/sharp/lib/constructor.js +499 -0
  87. package/webapp-dist/node_modules/sharp/lib/index.js +16 -0
  88. package/webapp-dist/node_modules/sharp/lib/input.js +809 -0
  89. package/webapp-dist/node_modules/sharp/lib/is.js +143 -0
  90. package/webapp-dist/node_modules/sharp/lib/libvips.js +207 -0
  91. package/webapp-dist/node_modules/sharp/lib/operation.js +1016 -0
  92. package/webapp-dist/node_modules/sharp/lib/output.js +1666 -0
  93. package/webapp-dist/node_modules/sharp/lib/resize.js +595 -0
  94. package/webapp-dist/node_modules/sharp/lib/sharp.js +121 -0
  95. package/webapp-dist/node_modules/sharp/lib/utility.js +291 -0
  96. package/webapp-dist/node_modules/sharp/package.json +202 -0
  97. package/webapp-dist/node_modules/source-map/lib/array-set.js +121 -0
  98. package/webapp-dist/node_modules/source-map/lib/base64-vlq.js +140 -0
  99. package/webapp-dist/node_modules/source-map/lib/base64.js +67 -0
  100. package/webapp-dist/node_modules/source-map/lib/binary-search.js +111 -0
  101. package/webapp-dist/node_modules/source-map/lib/mapping-list.js +79 -0
  102. package/webapp-dist/node_modules/source-map/lib/quick-sort.js +114 -0
  103. package/webapp-dist/node_modules/source-map/lib/source-map-consumer.js +1145 -0
  104. package/webapp-dist/node_modules/source-map/lib/source-map-generator.js +425 -0
  105. package/webapp-dist/node_modules/source-map/lib/source-node.js +413 -0
  106. package/webapp-dist/node_modules/source-map/lib/util.js +488 -0
  107. package/webapp-dist/node_modules/source-map/package.json +73 -0
  108. package/webapp-dist/node_modules/source-map/source-map.js +8 -0
  109. package/webapp-dist/node_modules/source-map-support/LICENSE.md +21 -0
  110. package/webapp-dist/node_modules/source-map-support/README.md +284 -0
  111. package/webapp-dist/node_modules/source-map-support/browser-source-map-support.js +114 -0
  112. package/webapp-dist/node_modules/source-map-support/package.json +31 -0
  113. package/webapp-dist/node_modules/source-map-support/register-hook-require.js +1 -0
  114. package/webapp-dist/node_modules/source-map-support/register.js +1 -0
  115. package/webapp-dist/node_modules/source-map-support/source-map-support.js +625 -0
  116. package/webapp-dist/node_modules/styled-jsx/dist/index/index.js +499 -0
  117. package/webapp-dist/node_modules/styled-jsx/index.js +1 -0
  118. package/webapp-dist/node_modules/styled-jsx/package.json +132 -0
  119. package/webapp-dist/node_modules/styled-jsx/style.js +1 -0
  120. package/webapp-dist/node_modules/typescript/lib/_tsc.js +133818 -0
  121. package/webapp-dist/node_modules/typescript/lib/_tsserver.js +659 -0
  122. package/webapp-dist/node_modules/typescript/lib/_typingsInstaller.js +222 -0
  123. package/webapp-dist/node_modules/typescript/lib/cs/diagnosticMessages.generated.json +2122 -0
  124. package/webapp-dist/node_modules/typescript/lib/de/diagnosticMessages.generated.json +2122 -0
  125. package/webapp-dist/node_modules/typescript/lib/es/diagnosticMessages.generated.json +2122 -0
  126. package/webapp-dist/node_modules/typescript/lib/fr/diagnosticMessages.generated.json +2122 -0
  127. package/webapp-dist/node_modules/typescript/lib/it/diagnosticMessages.generated.json +2122 -0
  128. package/webapp-dist/node_modules/typescript/lib/ja/diagnosticMessages.generated.json +2122 -0
  129. package/webapp-dist/node_modules/typescript/lib/ko/diagnosticMessages.generated.json +2122 -0
  130. package/webapp-dist/node_modules/typescript/lib/pl/diagnosticMessages.generated.json +2122 -0
  131. package/webapp-dist/node_modules/typescript/lib/pt-br/diagnosticMessages.generated.json +2122 -0
  132. package/webapp-dist/node_modules/typescript/lib/ru/diagnosticMessages.generated.json +2122 -0
  133. package/webapp-dist/node_modules/typescript/lib/tr/diagnosticMessages.generated.json +2122 -0
  134. package/webapp-dist/node_modules/typescript/lib/tsc.js +8 -0
  135. package/webapp-dist/node_modules/typescript/lib/tsserver.js +8 -0
  136. package/webapp-dist/node_modules/typescript/lib/tsserverlibrary.js +21 -0
  137. package/webapp-dist/node_modules/typescript/lib/typesMap.json +497 -0
  138. package/webapp-dist/node_modules/typescript/lib/typescript.js +200276 -0
  139. package/webapp-dist/node_modules/typescript/lib/typingsInstaller.js +8 -0
  140. package/webapp-dist/node_modules/typescript/lib/watchGuard.js +53 -0
  141. package/webapp-dist/node_modules/typescript/lib/zh-cn/diagnosticMessages.generated.json +2122 -0
  142. package/webapp-dist/node_modules/typescript/lib/zh-tw/diagnosticMessages.generated.json +2122 -0
  143. package/webapp-dist/node_modules/typescript/package.json +120 -0
  144. /package/webapp-dist/.next/static/{CBqL8_eR5V0p4TChjPNMj → 6d9vQZJNWnbBaVrpBo9kx}/_buildManifest.js +0 -0
  145. /package/webapp-dist/.next/static/{CBqL8_eR5V0p4TChjPNMj → 6d9vQZJNWnbBaVrpBo9kx}/_clientMiddlewareManifest.json +0 -0
  146. /package/webapp-dist/.next/static/{CBqL8_eR5V0p4TChjPNMj → 6d9vQZJNWnbBaVrpBo9kx}/_ssgManifest.js +0 -0
@@ -0,0 +1,499 @@
1
+ require('client-only');
2
+ var React = require('react');
3
+
4
+ function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
5
+
6
+ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
7
+
8
+ /*
9
+ Based on Glamor's sheet
10
+ https://github.com/threepointone/glamor/blob/667b480d31b3721a905021b26e1290ce92ca2879/src/sheet.js
11
+ */ function _defineProperties(target, props) {
12
+ for(var i = 0; i < props.length; i++){
13
+ var descriptor = props[i];
14
+ descriptor.enumerable = descriptor.enumerable || false;
15
+ descriptor.configurable = true;
16
+ if ("value" in descriptor) descriptor.writable = true;
17
+ Object.defineProperty(target, descriptor.key, descriptor);
18
+ }
19
+ }
20
+ function _createClass(Constructor, protoProps, staticProps) {
21
+ if (protoProps) _defineProperties(Constructor.prototype, protoProps);
22
+ if (staticProps) _defineProperties(Constructor, staticProps);
23
+ return Constructor;
24
+ }
25
+ var isProd = typeof process !== "undefined" && process.env && process.env.NODE_ENV === "production";
26
+ var isString = function(o) {
27
+ return Object.prototype.toString.call(o) === "[object String]";
28
+ };
29
+ var StyleSheet = /*#__PURE__*/ function() {
30
+ function StyleSheet(param) {
31
+ var ref = param === void 0 ? {} : param, _name = ref.name, name = _name === void 0 ? "stylesheet" : _name, _optimizeForSpeed = ref.optimizeForSpeed, optimizeForSpeed = _optimizeForSpeed === void 0 ? isProd : _optimizeForSpeed;
32
+ invariant$1(isString(name), "`name` must be a string");
33
+ this._name = name;
34
+ this._deletedRulePlaceholder = "#" + name + "-deleted-rule____{}";
35
+ invariant$1(typeof optimizeForSpeed === "boolean", "`optimizeForSpeed` must be a boolean");
36
+ this._optimizeForSpeed = optimizeForSpeed;
37
+ this._serverSheet = undefined;
38
+ this._tags = [];
39
+ this._injected = false;
40
+ this._rulesCount = 0;
41
+ var node = typeof window !== "undefined" && document.querySelector('meta[property="csp-nonce"]');
42
+ this._nonce = node ? node.getAttribute("content") : null;
43
+ }
44
+ var _proto = StyleSheet.prototype;
45
+ _proto.setOptimizeForSpeed = function setOptimizeForSpeed(bool) {
46
+ invariant$1(typeof bool === "boolean", "`setOptimizeForSpeed` accepts a boolean");
47
+ invariant$1(this._rulesCount === 0, "optimizeForSpeed cannot be when rules have already been inserted");
48
+ this.flush();
49
+ this._optimizeForSpeed = bool;
50
+ this.inject();
51
+ };
52
+ _proto.isOptimizeForSpeed = function isOptimizeForSpeed() {
53
+ return this._optimizeForSpeed;
54
+ };
55
+ _proto.inject = function inject() {
56
+ var _this = this;
57
+ invariant$1(!this._injected, "sheet already injected");
58
+ this._injected = true;
59
+ if (typeof window !== "undefined" && this._optimizeForSpeed) {
60
+ this._tags[0] = this.makeStyleTag(this._name);
61
+ this._optimizeForSpeed = "insertRule" in this.getSheet();
62
+ if (!this._optimizeForSpeed) {
63
+ if (!isProd) {
64
+ console.warn("StyleSheet: optimizeForSpeed mode not supported falling back to standard mode.");
65
+ }
66
+ this.flush();
67
+ this._injected = true;
68
+ }
69
+ return;
70
+ }
71
+ this._serverSheet = {
72
+ cssRules: [],
73
+ insertRule: function(rule, index) {
74
+ if (typeof index === "number") {
75
+ _this._serverSheet.cssRules[index] = {
76
+ cssText: rule
77
+ };
78
+ } else {
79
+ _this._serverSheet.cssRules.push({
80
+ cssText: rule
81
+ });
82
+ }
83
+ return index;
84
+ },
85
+ deleteRule: function(index) {
86
+ _this._serverSheet.cssRules[index] = null;
87
+ }
88
+ };
89
+ };
90
+ _proto.getSheetForTag = function getSheetForTag(tag) {
91
+ if (tag.sheet) {
92
+ return tag.sheet;
93
+ }
94
+ // this weirdness brought to you by firefox
95
+ for(var i = 0; i < document.styleSheets.length; i++){
96
+ if (document.styleSheets[i].ownerNode === tag) {
97
+ return document.styleSheets[i];
98
+ }
99
+ }
100
+ };
101
+ _proto.getSheet = function getSheet() {
102
+ return this.getSheetForTag(this._tags[this._tags.length - 1]);
103
+ };
104
+ _proto.insertRule = function insertRule(rule, index) {
105
+ invariant$1(isString(rule), "`insertRule` accepts only strings");
106
+ if (typeof window === "undefined") {
107
+ if (typeof index !== "number") {
108
+ index = this._serverSheet.cssRules.length;
109
+ }
110
+ this._serverSheet.insertRule(rule, index);
111
+ return this._rulesCount++;
112
+ }
113
+ if (this._optimizeForSpeed) {
114
+ var sheet = this.getSheet();
115
+ if (typeof index !== "number") {
116
+ index = sheet.cssRules.length;
117
+ }
118
+ // this weirdness for perf, and chrome's weird bug
119
+ // https://stackoverflow.com/questions/20007992/chrome-suddenly-stopped-accepting-insertrule
120
+ try {
121
+ sheet.insertRule(rule, index);
122
+ } catch (error) {
123
+ if (!isProd) {
124
+ console.warn("StyleSheet: illegal rule: \n\n" + rule + "\n\nSee https://stackoverflow.com/q/20007992 for more info");
125
+ }
126
+ return -1;
127
+ }
128
+ } else {
129
+ var insertionPoint = this._tags[index];
130
+ this._tags.push(this.makeStyleTag(this._name, rule, insertionPoint));
131
+ }
132
+ return this._rulesCount++;
133
+ };
134
+ _proto.replaceRule = function replaceRule(index, rule) {
135
+ if (this._optimizeForSpeed || typeof window === "undefined") {
136
+ var sheet = typeof window !== "undefined" ? this.getSheet() : this._serverSheet;
137
+ if (!rule.trim()) {
138
+ rule = this._deletedRulePlaceholder;
139
+ }
140
+ if (!sheet.cssRules[index]) {
141
+ // @TBD Should we throw an error?
142
+ return index;
143
+ }
144
+ sheet.deleteRule(index);
145
+ try {
146
+ sheet.insertRule(rule, index);
147
+ } catch (error) {
148
+ if (!isProd) {
149
+ console.warn("StyleSheet: illegal rule: \n\n" + rule + "\n\nSee https://stackoverflow.com/q/20007992 for more info");
150
+ }
151
+ // In order to preserve the indices we insert a deleteRulePlaceholder
152
+ sheet.insertRule(this._deletedRulePlaceholder, index);
153
+ }
154
+ } else {
155
+ var tag = this._tags[index];
156
+ invariant$1(tag, "old rule at index `" + index + "` not found");
157
+ tag.textContent = rule;
158
+ }
159
+ return index;
160
+ };
161
+ _proto.deleteRule = function deleteRule(index) {
162
+ if (typeof window === "undefined") {
163
+ this._serverSheet.deleteRule(index);
164
+ return;
165
+ }
166
+ if (this._optimizeForSpeed) {
167
+ this.replaceRule(index, "");
168
+ } else {
169
+ var tag = this._tags[index];
170
+ invariant$1(tag, "rule at index `" + index + "` not found");
171
+ tag.parentNode.removeChild(tag);
172
+ this._tags[index] = null;
173
+ }
174
+ };
175
+ _proto.flush = function flush() {
176
+ this._injected = false;
177
+ this._rulesCount = 0;
178
+ if (typeof window !== "undefined") {
179
+ this._tags.forEach(function(tag) {
180
+ return tag && tag.parentNode.removeChild(tag);
181
+ });
182
+ this._tags = [];
183
+ } else {
184
+ // simpler on server
185
+ this._serverSheet.cssRules = [];
186
+ }
187
+ };
188
+ _proto.cssRules = function cssRules() {
189
+ var _this = this;
190
+ if (typeof window === "undefined") {
191
+ return this._serverSheet.cssRules;
192
+ }
193
+ return this._tags.reduce(function(rules, tag) {
194
+ if (tag) {
195
+ rules = rules.concat(Array.prototype.map.call(_this.getSheetForTag(tag).cssRules, function(rule) {
196
+ return rule.cssText === _this._deletedRulePlaceholder ? null : rule;
197
+ }));
198
+ } else {
199
+ rules.push(null);
200
+ }
201
+ return rules;
202
+ }, []);
203
+ };
204
+ _proto.makeStyleTag = function makeStyleTag(name, cssString, relativeToTag) {
205
+ if (cssString) {
206
+ invariant$1(isString(cssString), "makeStyleTag accepts only strings as second parameter");
207
+ }
208
+ var tag = document.createElement("style");
209
+ if (this._nonce) tag.setAttribute("nonce", this._nonce);
210
+ tag.type = "text/css";
211
+ tag.setAttribute("data-" + name, "");
212
+ if (cssString) {
213
+ tag.appendChild(document.createTextNode(cssString));
214
+ }
215
+ var head = document.head || document.getElementsByTagName("head")[0];
216
+ if (relativeToTag) {
217
+ head.insertBefore(tag, relativeToTag);
218
+ } else {
219
+ head.appendChild(tag);
220
+ }
221
+ return tag;
222
+ };
223
+ _createClass(StyleSheet, [
224
+ {
225
+ key: "length",
226
+ get: function get() {
227
+ return this._rulesCount;
228
+ }
229
+ }
230
+ ]);
231
+ return StyleSheet;
232
+ }();
233
+ function invariant$1(condition, message) {
234
+ if (!condition) {
235
+ throw new Error("StyleSheet: " + message + ".");
236
+ }
237
+ }
238
+
239
+ function hash(str) {
240
+ var _$hash = 5381, i = str.length;
241
+ while(i){
242
+ _$hash = _$hash * 33 ^ str.charCodeAt(--i);
243
+ }
244
+ /* JavaScript does bitwise operations (like XOR, above) on 32-bit signed
245
+ * integers. Since we want the results to be always positive, convert the
246
+ * signed int to an unsigned by doing an unsigned bitshift. */ return _$hash >>> 0;
247
+ }
248
+ var stringHash = hash;
249
+
250
+ var sanitize = function(rule) {
251
+ return rule.replace(/\/style/gi, "\\/style");
252
+ };
253
+ var cache = {};
254
+ /**
255
+ * computeId
256
+ *
257
+ * Compute and memoize a jsx id from a basedId and optionally props.
258
+ */ function computeId(baseId, props) {
259
+ if (!props) {
260
+ return "jsx-" + baseId;
261
+ }
262
+ var propsToString = String(props);
263
+ var key = baseId + propsToString;
264
+ if (!cache[key]) {
265
+ cache[key] = "jsx-" + stringHash(baseId + "-" + propsToString);
266
+ }
267
+ return cache[key];
268
+ }
269
+ /**
270
+ * computeSelector
271
+ *
272
+ * Compute and memoize dynamic selectors.
273
+ */ function computeSelector(id, css) {
274
+ var selectoPlaceholderRegexp = /__jsx-style-dynamic-selector/g;
275
+ // Sanitize SSR-ed CSS.
276
+ // Client side code doesn't need to be sanitized since we use
277
+ // document.createTextNode (dev) and the CSSOM api sheet.insertRule (prod).
278
+ if (typeof window === "undefined") {
279
+ css = sanitize(css);
280
+ }
281
+ var idcss = id + css;
282
+ if (!cache[idcss]) {
283
+ cache[idcss] = css.replace(selectoPlaceholderRegexp, id);
284
+ }
285
+ return cache[idcss];
286
+ }
287
+
288
+ function mapRulesToStyle(cssRules, options) {
289
+ if (options === void 0) options = {};
290
+ return cssRules.map(function(args) {
291
+ var id = args[0];
292
+ var css = args[1];
293
+ return /*#__PURE__*/ React__default["default"].createElement("style", {
294
+ id: "__" + id,
295
+ // Avoid warnings upon render with a key
296
+ key: "__" + id,
297
+ nonce: options.nonce ? options.nonce : undefined,
298
+ dangerouslySetInnerHTML: {
299
+ __html: css
300
+ }
301
+ });
302
+ });
303
+ }
304
+ var StyleSheetRegistry = /*#__PURE__*/ function() {
305
+ function StyleSheetRegistry(param) {
306
+ var ref = param === void 0 ? {} : param, _styleSheet = ref.styleSheet, styleSheet = _styleSheet === void 0 ? null : _styleSheet, _optimizeForSpeed = ref.optimizeForSpeed, optimizeForSpeed = _optimizeForSpeed === void 0 ? false : _optimizeForSpeed;
307
+ this._sheet = styleSheet || new StyleSheet({
308
+ name: "styled-jsx",
309
+ optimizeForSpeed: optimizeForSpeed
310
+ });
311
+ this._sheet.inject();
312
+ if (styleSheet && typeof optimizeForSpeed === "boolean") {
313
+ this._sheet.setOptimizeForSpeed(optimizeForSpeed);
314
+ this._optimizeForSpeed = this._sheet.isOptimizeForSpeed();
315
+ }
316
+ this._fromServer = undefined;
317
+ this._indices = {};
318
+ this._instancesCounts = {};
319
+ }
320
+ var _proto = StyleSheetRegistry.prototype;
321
+ _proto.add = function add(props) {
322
+ var _this = this;
323
+ if (undefined === this._optimizeForSpeed) {
324
+ this._optimizeForSpeed = Array.isArray(props.children);
325
+ this._sheet.setOptimizeForSpeed(this._optimizeForSpeed);
326
+ this._optimizeForSpeed = this._sheet.isOptimizeForSpeed();
327
+ }
328
+ if (typeof window !== "undefined" && !this._fromServer) {
329
+ this._fromServer = this.selectFromServer();
330
+ this._instancesCounts = Object.keys(this._fromServer).reduce(function(acc, tagName) {
331
+ acc[tagName] = 0;
332
+ return acc;
333
+ }, {});
334
+ }
335
+ var ref = this.getIdAndRules(props), styleId = ref.styleId, rules = ref.rules;
336
+ // Deduping: just increase the instances count.
337
+ if (styleId in this._instancesCounts) {
338
+ this._instancesCounts[styleId] += 1;
339
+ return;
340
+ }
341
+ var indices = rules.map(function(rule) {
342
+ return _this._sheet.insertRule(rule);
343
+ })// Filter out invalid rules
344
+ .filter(function(index) {
345
+ return index !== -1;
346
+ });
347
+ this._indices[styleId] = indices;
348
+ this._instancesCounts[styleId] = 1;
349
+ };
350
+ _proto.remove = function remove(props) {
351
+ var _this = this;
352
+ var styleId = this.getIdAndRules(props).styleId;
353
+ invariant(styleId in this._instancesCounts, "styleId: `" + styleId + "` not found");
354
+ this._instancesCounts[styleId] -= 1;
355
+ if (this._instancesCounts[styleId] < 1) {
356
+ var tagFromServer = this._fromServer && this._fromServer[styleId];
357
+ if (tagFromServer) {
358
+ tagFromServer.parentNode.removeChild(tagFromServer);
359
+ delete this._fromServer[styleId];
360
+ } else {
361
+ this._indices[styleId].forEach(function(index) {
362
+ return _this._sheet.deleteRule(index);
363
+ });
364
+ delete this._indices[styleId];
365
+ }
366
+ delete this._instancesCounts[styleId];
367
+ }
368
+ };
369
+ _proto.update = function update(props, nextProps) {
370
+ this.add(nextProps);
371
+ this.remove(props);
372
+ };
373
+ _proto.flush = function flush() {
374
+ this._sheet.flush();
375
+ this._sheet.inject();
376
+ this._fromServer = undefined;
377
+ this._indices = {};
378
+ this._instancesCounts = {};
379
+ };
380
+ _proto.cssRules = function cssRules() {
381
+ var _this = this;
382
+ var fromServer = this._fromServer ? Object.keys(this._fromServer).map(function(styleId) {
383
+ return [
384
+ styleId,
385
+ _this._fromServer[styleId]
386
+ ];
387
+ }) : [];
388
+ var cssRules = this._sheet.cssRules();
389
+ return fromServer.concat(Object.keys(this._indices).map(function(styleId) {
390
+ return [
391
+ styleId,
392
+ _this._indices[styleId].map(function(index) {
393
+ return cssRules[index].cssText;
394
+ }).join(_this._optimizeForSpeed ? "" : "\n")
395
+ ];
396
+ })// filter out empty rules
397
+ .filter(function(rule) {
398
+ return Boolean(rule[1]);
399
+ }));
400
+ };
401
+ _proto.styles = function styles(options) {
402
+ return mapRulesToStyle(this.cssRules(), options);
403
+ };
404
+ _proto.getIdAndRules = function getIdAndRules(props) {
405
+ var css = props.children, dynamic = props.dynamic, id = props.id;
406
+ if (dynamic) {
407
+ var styleId = computeId(id, dynamic);
408
+ return {
409
+ styleId: styleId,
410
+ rules: Array.isArray(css) ? css.map(function(rule) {
411
+ return computeSelector(styleId, rule);
412
+ }) : [
413
+ computeSelector(styleId, css)
414
+ ]
415
+ };
416
+ }
417
+ return {
418
+ styleId: computeId(id),
419
+ rules: Array.isArray(css) ? css : [
420
+ css
421
+ ]
422
+ };
423
+ };
424
+ /**
425
+ * selectFromServer
426
+ *
427
+ * Collects style tags from the document with id __jsx-XXX
428
+ */ _proto.selectFromServer = function selectFromServer() {
429
+ var elements = Array.prototype.slice.call(document.querySelectorAll('[id^="__jsx-"]'));
430
+ return elements.reduce(function(acc, element) {
431
+ var id = element.id.slice(2);
432
+ acc[id] = element;
433
+ return acc;
434
+ }, {});
435
+ };
436
+ return StyleSheetRegistry;
437
+ }();
438
+ function invariant(condition, message) {
439
+ if (!condition) {
440
+ throw new Error("StyleSheetRegistry: " + message + ".");
441
+ }
442
+ }
443
+ var StyleSheetContext = /*#__PURE__*/ React.createContext(null);
444
+ StyleSheetContext.displayName = "StyleSheetContext";
445
+ function createStyleRegistry() {
446
+ return new StyleSheetRegistry();
447
+ }
448
+ function StyleRegistry(param) {
449
+ var configuredRegistry = param.registry, children = param.children;
450
+ var rootRegistry = React.useContext(StyleSheetContext);
451
+ var ref = React.useState(function() {
452
+ return rootRegistry || configuredRegistry || createStyleRegistry();
453
+ }), registry = ref[0];
454
+ return /*#__PURE__*/ React__default["default"].createElement(StyleSheetContext.Provider, {
455
+ value: registry
456
+ }, children);
457
+ }
458
+ function useStyleRegistry() {
459
+ return React.useContext(StyleSheetContext);
460
+ }
461
+
462
+ // Opt-into the new `useInsertionEffect` API in React 18, fallback to `useLayoutEffect`.
463
+ // https://github.com/reactwg/react-18/discussions/110
464
+ var useInsertionEffect = React__default["default"].useInsertionEffect || React__default["default"].useLayoutEffect;
465
+ var defaultRegistry = typeof window !== "undefined" ? createStyleRegistry() : undefined;
466
+ function JSXStyle(props) {
467
+ var registry = defaultRegistry ? defaultRegistry : useStyleRegistry();
468
+ // If `registry` does not exist, we do nothing here.
469
+ if (!registry) {
470
+ return null;
471
+ }
472
+ if (typeof window === "undefined") {
473
+ registry.add(props);
474
+ return null;
475
+ }
476
+ useInsertionEffect(function() {
477
+ registry.add(props);
478
+ return function() {
479
+ registry.remove(props);
480
+ };
481
+ // props.children can be string[], will be striped since id is identical
482
+ }, [
483
+ props.id,
484
+ String(props.dynamic)
485
+ ]);
486
+ return null;
487
+ }
488
+ JSXStyle.dynamic = function(info) {
489
+ return info.map(function(tagInfo) {
490
+ var baseId = tagInfo[0];
491
+ var props = tagInfo[1];
492
+ return computeId(baseId, props);
493
+ }).join(" ");
494
+ };
495
+
496
+ exports.StyleRegistry = StyleRegistry;
497
+ exports.createStyleRegistry = createStyleRegistry;
498
+ exports.style = JSXStyle;
499
+ exports.useStyleRegistry = useStyleRegistry;
@@ -0,0 +1 @@
1
+ module.exports = require('./dist/index')
@@ -0,0 +1,132 @@
1
+ {
2
+ "name": "styled-jsx",
3
+ "version": "5.1.6",
4
+ "license": "MIT",
5
+ "repository": "vercel/styled-jsx",
6
+ "description": "Full CSS support for JSX without compromises",
7
+ "files": [
8
+ "dist",
9
+ "lib",
10
+ "global.d.ts",
11
+ "index.d.ts",
12
+ "index.js",
13
+ "babel.js",
14
+ "babel-test.js",
15
+ "style.js",
16
+ "style.d.ts",
17
+ "macro.js",
18
+ "macro.d.ts",
19
+ "css.js",
20
+ "css.d.ts",
21
+ "webpack.js",
22
+ "license.md"
23
+ ],
24
+ "typings": "./index.d.ts",
25
+ "scripts": {
26
+ "build-babel": "bunchee src/babel.js -f cjs -e babel-plugin-macros --runtime node -o dist/babel/index.js",
27
+ "build": "rm -rf dist && rm -rf out && yarn build-webpack && yarn build-index && yarn build-babel",
28
+ "build-webpack": "bunchee src/webpack.js -f cjs --runtime node -o dist/webpack/index.js",
29
+ "build-index": "bunchee src/index.js -f cjs --runtime node -o dist/index/index.js",
30
+ "test": "ava",
31
+ "test-types": "tsc --project tsconfig.json --noEmit",
32
+ "lint": "eslint ./src",
33
+ "format": "prettier --write \"./{src,test}/**/*.{js,css}\"",
34
+ "prepublishOnly": "yarn build && yarn test && yarn lint --quiet"
35
+ },
36
+ "husky": {
37
+ "hooks": {
38
+ "pre-commit": "pretty-quick --staged"
39
+ }
40
+ },
41
+ "ava": {
42
+ "require": [
43
+ "@babel/register"
44
+ ]
45
+ },
46
+ "eslintConfig": {
47
+ "env": {
48
+ "node": true,
49
+ "browser": true,
50
+ "es6": true
51
+ },
52
+ "extends": [
53
+ "eslint:recommended",
54
+ "prettier"
55
+ ],
56
+ "parserOptions": {
57
+ "ecmaVersion": 11,
58
+ "sourceType": "module"
59
+ },
60
+ "rules": {
61
+ "no-empty": 0,
62
+ "capitalized-comments": 0,
63
+ "valid-jsdoc": 0,
64
+ "prefer-destructuring": 0,
65
+ "padding-line-between-statements": 0
66
+ }
67
+ },
68
+ "devDependencies": {
69
+ "@babel/cli": "7.18.10",
70
+ "@babel/core": "7.12.3",
71
+ "@babel/plugin-proposal-object-rest-spread": "7.12.1",
72
+ "@babel/plugin-syntax-jsx": "7.14.5",
73
+ "@babel/plugin-transform-arrow-functions": "7.12.1",
74
+ "@babel/plugin-transform-modules-commonjs": "7.12.1",
75
+ "@babel/plugin-transform-runtime": "7.12.1",
76
+ "@babel/preset-env": "7.12.1",
77
+ "@babel/preset-react": "7.12.5",
78
+ "@babel/register": "7.12.1",
79
+ "@babel/runtime": "7.12.5",
80
+ "@babel/types": "7.15.0",
81
+ "@types/react": "18.3.3",
82
+ "ava": "4.3.1",
83
+ "babel-plugin-macros": "2.8.0",
84
+ "bunchee": "2.1.5",
85
+ "convert-source-map": "1.7.0",
86
+ "eslint": "7.32.0",
87
+ "eslint-config-prettier": "4.0.0",
88
+ "husky": "4.3.0",
89
+ "loader-utils": "1.4.2",
90
+ "prettier": "1.16.4",
91
+ "pretty-quick": "3.1.0",
92
+ "react": "17.0.1",
93
+ "react-dom": "17.0.1",
94
+ "semantic-release": "17.2.2",
95
+ "source-map": "0.7.3",
96
+ "string-hash": "1.1.3",
97
+ "stylis": "3.5.4",
98
+ "stylis-rule-sheet": "0.0.10",
99
+ "typescript": "~5.0.0"
100
+ },
101
+ "peerDependencies": {
102
+ "react": ">= 16.8.0 || 17.x.x || ^18.0.0-0 || ^19.0.0-0"
103
+ },
104
+ "peerDependenciesMeta": {
105
+ "@babel/core": {
106
+ "optional": true
107
+ },
108
+ "babel-plugin-macros": {
109
+ "optional": true
110
+ }
111
+ },
112
+ "release": {
113
+ "branches": [
114
+ "main",
115
+ "alpha",
116
+ "beta"
117
+ ]
118
+ },
119
+ "engines": {
120
+ "node": ">= 12.0.0"
121
+ },
122
+ "keywords": [
123
+ "babel-plugin-macros",
124
+ "vercel",
125
+ "zeit",
126
+ "css-in-js",
127
+ "css"
128
+ ],
129
+ "dependencies": {
130
+ "client-only": "0.0.1"
131
+ }
132
+ }
@@ -0,0 +1 @@
1
+ module.exports = require('./dist/index').style