timvir 0.2.1 → 0.2.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.
Files changed (41) hide show
  1. package/blocks/Arbitrary/index.js +20 -29
  2. package/blocks/Arbitrary/styles.css +1 -0
  3. package/blocks/Code/index.js +23 -19
  4. package/blocks/Code/styles.css +3 -1
  5. package/blocks/ColorBar/index.js +18 -14
  6. package/blocks/ColorBar/styles.css +1 -0
  7. package/blocks/ColorBook/index.js +18 -14
  8. package/blocks/ColorBook/styles.css +1 -0
  9. package/blocks/Cover/index.js +18 -13
  10. package/blocks/Cover/styles.css +1 -0
  11. package/blocks/Exhibit/index.js +18 -13
  12. package/blocks/Exhibit/styles.css +1 -0
  13. package/blocks/Font/index.js +23 -17
  14. package/blocks/Font/styles.css +1 -0
  15. package/blocks/Grid/index.js +16 -12
  16. package/blocks/Grid/styles.css +1 -0
  17. package/blocks/Icon/index.js +17 -20
  18. package/blocks/Icon/styles.css +4 -2
  19. package/blocks/Message/index.js +16 -12
  20. package/blocks/Message/styles.css +1 -0
  21. package/blocks/Swatch/index.js +16 -12
  22. package/blocks/Swatch/styles.css +1 -0
  23. package/blocks/Viewport/index.js +22 -30
  24. package/blocks/Viewport/styles.css +10 -6
  25. package/blocks/WebLink/index.js +16 -14
  26. package/blocks/WebLink/styles.css +1 -0
  27. package/blocks/styles.css +27 -9
  28. package/bus/index.js +1 -1
  29. package/bus/styles.css +1 -0
  30. package/context/index.js +0 -2
  31. package/context/styles.css +1 -0
  32. package/core/components/Page/components.d.ts +14 -14
  33. package/core/index.js +105 -734
  34. package/core/layout.d.ts +2 -2
  35. package/core/styles.css +32 -21
  36. package/hooks/index.js +3 -10
  37. package/hooks/styles.css +1 -0
  38. package/package.json +3 -3
  39. package/search/index.js +30 -37
  40. package/search/styles.css +9 -6
  41. package/styles.css +71 -36
@@ -17,36 +17,41 @@ import * as Icons from 'react-feather';
17
17
  * @returns the combined, space separated class names that can be applied directly to the class attribute
18
18
  */
19
19
  const cx = function cx() {
20
- const presentClassNames = Array.prototype.slice.call(arguments).filter(Boolean);
20
+ const presentClassNames = Array.prototype.slice // eslint-disable-next-line prefer-rest-params
21
+ .call(arguments).filter(Boolean);
21
22
  const atomicClasses = {};
22
23
  const nonAtomicClasses = [];
23
-
24
- for (const className of presentClassNames) {
24
+ presentClassNames.forEach(arg => {
25
25
  // className could be the output of a previous cx call, so split by ' ' first
26
- const individualClassNames = className.split(' ');
27
-
28
- for (const className of individualClassNames) {
26
+ const individualClassNames = arg ? arg.split(' ') : [];
27
+ individualClassNames.forEach(className => {
29
28
  if (className.startsWith('atm_')) {
30
29
  const [, keyHash] = className.split('_');
31
30
  atomicClasses[keyHash] = className;
32
31
  } else {
33
32
  nonAtomicClasses.push(className);
34
33
  }
34
+ });
35
+ });
36
+ const result = []; // eslint-disable-next-line no-restricted-syntax
37
+
38
+ for (const keyHash in atomicClasses) {
39
+ if (Object.prototype.hasOwnProperty.call(atomicClasses, keyHash)) {
40
+ result.push(atomicClasses[keyHash]);
35
41
  }
36
42
  }
37
-
38
- return [...Object.values(atomicClasses), ...nonAtomicClasses].join(' ');
43
+ result.push(...nonAtomicClasses);
44
+ return result.join(' ');
39
45
  };
46
+ var cx$1 = cx;
40
47
 
41
48
  /**
42
49
  * The underlying DOM element which is rendered by this component.
43
50
  */
44
-
45
51
  const Root = "div";
46
52
  const classes = {
47
53
  meta: "mby32tn"
48
54
  };
49
-
50
55
  function Font(props, ref) {
51
56
  const components = {
52
57
  h3: "h3",
@@ -69,7 +74,6 @@ function Font(props, ref) {
69
74
  const intervalId = setInterval(() => {
70
75
  if (fontSizeRef) {
71
76
  const innerText = `${name} – ${Math.round(parseInt(computedStyle.fontSize))}px`;
72
-
73
77
  if (fontSizeRef.innerText !== innerText) {
74
78
  fontSizeRef.innerText = innerText;
75
79
  }
@@ -82,7 +86,7 @@ function Font(props, ref) {
82
86
  }, [name, contentRef]);
83
87
  return /*#__PURE__*/React.createElement(Root, {
84
88
  ref: ref,
85
- className: cx(className, "rc7ivp5"),
89
+ className: cx$1(className, "rc7ivp5"),
86
90
  ...rest
87
91
  }, /*#__PURE__*/React.createElement("div", {
88
92
  className: classes.meta
@@ -96,14 +100,17 @@ function Font(props, ref) {
96
100
  if (infoRef && contentRef) {
97
101
  // const contentParent = contentRef.parentElement;
98
102
  const infoParent = infoRef.parentElement;
99
-
100
103
  if (infoParent.style.height === "0px") {
101
104
  infoParent.style.height = `${infoRef.getBoundingClientRect().height}px`;
102
- infoParent.style.opacity = "1"; // contentParent.style.height = "0px";
105
+ infoParent.style.opacity = "1";
106
+
107
+ // contentParent.style.height = "0px";
103
108
  // contentParent.style.opacity = "0";
104
109
  } else {
105
110
  infoParent.style.height = "0px";
106
- infoParent.style.opacity = "0"; // contentParent.style.height = window.getComputedStyle(contentRef).height;
111
+ infoParent.style.opacity = "0";
112
+
113
+ // contentParent.style.height = window.getComputedStyle(contentRef).height;
107
114
  // contentParent.style.opacity = "1";
108
115
  }
109
116
  }
@@ -131,11 +138,10 @@ function Font(props, ref) {
131
138
  ref: setContentRef,
132
139
  contentEditable: true,
133
140
  spellCheck: "false",
134
- className: cx(font.className, "dx3nfmc"),
141
+ className: cx$1(font.className, "dx3nfmc"),
135
142
  style: font.style
136
143
  }, children || "The quick brown fox jumps over the lazy dog"))));
137
144
  }
138
-
139
145
  var Font$1 = /*#__PURE__*/React.forwardRef(Font);
140
146
 
141
147
  export { Font$1 as Font };
@@ -7,3 +7,4 @@
7
7
  .ddlplux{padding:0 0 16px;display:flex;flex-direction:column;}
8
8
  .dw285p4{overflow:hidden;transition:height 0.2s,opacity 0.2s 0.1s;}
9
9
  .dx3nfmc{outline:none;user-select:text;white-space:pre-wrap;overflow-wrap:break-word;}
10
+
@@ -15,33 +15,38 @@ import * as React from 'react';
15
15
  * @returns the combined, space separated class names that can be applied directly to the class attribute
16
16
  */
17
17
  const cx = function cx() {
18
- const presentClassNames = Array.prototype.slice.call(arguments).filter(Boolean);
18
+ const presentClassNames = Array.prototype.slice // eslint-disable-next-line prefer-rest-params
19
+ .call(arguments).filter(Boolean);
19
20
  const atomicClasses = {};
20
21
  const nonAtomicClasses = [];
21
-
22
- for (const className of presentClassNames) {
22
+ presentClassNames.forEach(arg => {
23
23
  // className could be the output of a previous cx call, so split by ' ' first
24
- const individualClassNames = className.split(' ');
25
-
26
- for (const className of individualClassNames) {
24
+ const individualClassNames = arg ? arg.split(' ') : [];
25
+ individualClassNames.forEach(className => {
27
26
  if (className.startsWith('atm_')) {
28
27
  const [, keyHash] = className.split('_');
29
28
  atomicClasses[keyHash] = className;
30
29
  } else {
31
30
  nonAtomicClasses.push(className);
32
31
  }
32
+ });
33
+ });
34
+ const result = []; // eslint-disable-next-line no-restricted-syntax
35
+
36
+ for (const keyHash in atomicClasses) {
37
+ if (Object.prototype.hasOwnProperty.call(atomicClasses, keyHash)) {
38
+ result.push(atomicClasses[keyHash]);
33
39
  }
34
40
  }
35
-
36
- return [...Object.values(atomicClasses), ...nonAtomicClasses].join(' ');
41
+ result.push(...nonAtomicClasses);
42
+ return result.join(' ');
37
43
  };
44
+ var cx$1 = cx;
38
45
 
39
46
  /**
40
47
  * The underlying DOM element which is rendered by this component.
41
48
  */
42
-
43
49
  const Root = "div";
44
-
45
50
  function Grid(props, ref) {
46
51
  const {
47
52
  children,
@@ -50,11 +55,10 @@ function Grid(props, ref) {
50
55
  } = props;
51
56
  return /*#__PURE__*/React.createElement(Root, {
52
57
  ref: ref,
53
- className: cx(className, classes.root),
58
+ className: cx$1(className, classes.root),
54
59
  ...rest
55
60
  }, children);
56
61
  }
57
-
58
62
  var Grid$1 = /*#__PURE__*/React.forwardRef(Grid);
59
63
  const classes = {
60
64
  root: "r1c1ozpm"
@@ -1 +1,2 @@
1
1
  .r1c1ozpm{display:grid;grid-template-columns:repeat(auto-fit,minmax(220px,1fr));gap:24px;}
2
+
@@ -16,33 +16,39 @@ import * as React from 'react';
16
16
  * @returns the combined, space separated class names that can be applied directly to the class attribute
17
17
  */
18
18
  const cx = function cx() {
19
- const presentClassNames = Array.prototype.slice.call(arguments).filter(Boolean);
19
+ const presentClassNames = Array.prototype.slice // eslint-disable-next-line prefer-rest-params
20
+ .call(arguments).filter(Boolean);
20
21
  const atomicClasses = {};
21
22
  const nonAtomicClasses = [];
22
-
23
- for (const className of presentClassNames) {
23
+ presentClassNames.forEach(arg => {
24
24
  // className could be the output of a previous cx call, so split by ' ' first
25
- const individualClassNames = className.split(' ');
26
-
27
- for (const className of individualClassNames) {
25
+ const individualClassNames = arg ? arg.split(' ') : [];
26
+ individualClassNames.forEach(className => {
28
27
  if (className.startsWith('atm_')) {
29
28
  const [, keyHash] = className.split('_');
30
29
  atomicClasses[keyHash] = className;
31
30
  } else {
32
31
  nonAtomicClasses.push(className);
33
32
  }
33
+ });
34
+ });
35
+ const result = []; // eslint-disable-next-line no-restricted-syntax
36
+
37
+ for (const keyHash in atomicClasses) {
38
+ if (Object.prototype.hasOwnProperty.call(atomicClasses, keyHash)) {
39
+ result.push(atomicClasses[keyHash]);
34
40
  }
35
41
  }
36
-
37
- return [...Object.values(atomicClasses), ...nonAtomicClasses].join(' ');
42
+ result.push(...nonAtomicClasses);
43
+ return result.join(' ');
38
44
  };
45
+ var cx$1 = cx;
39
46
 
40
47
  const Root$1 = "div";
41
48
  const classes$1 = {
42
49
  backdrop: "b1a0xzv7",
43
50
  grid: "g10obtzp"
44
51
  };
45
-
46
52
  function Canvas(props) {
47
53
  const {
48
54
  width,
@@ -68,7 +74,6 @@ function Canvas(props) {
68
74
  }
69
75
  }, /*#__PURE__*/React.createElement(Component, null)));
70
76
  }
71
-
72
77
  function Grid({
73
78
  size,
74
79
  ...rest
@@ -76,7 +81,6 @@ function Grid({
76
81
  const halfSize = size / 2;
77
82
  const center = 60;
78
83
  const whiskerLength = Math.min(16, size / 2);
79
-
80
84
  const Corner = ({
81
85
  dx,
82
86
  dy
@@ -95,11 +99,8 @@ function Grid({
95
99
  strokeWidth: 1,
96
100
  stroke: "#EEEEEE"
97
101
  }));
98
-
99
102
  const add = (a, b) => a + b;
100
-
101
103
  const sub = (a, b) => a - b;
102
-
103
104
  return /*#__PURE__*/React.createElement("svg", {
104
105
  width: "120",
105
106
  height: "120",
@@ -133,7 +134,6 @@ const Root = "div";
133
134
  const classes = {
134
135
  name: "n1xsexuc"
135
136
  };
136
-
137
137
  function Icon(props, ref) {
138
138
  const {
139
139
  descriptor,
@@ -144,22 +144,19 @@ function Icon(props, ref) {
144
144
  const width = roe === null || roe === void 0 ? void 0 : roe.contentRect.width;
145
145
  return /*#__PURE__*/React.createElement(Root, {
146
146
  ref: ref,
147
- className: cx(className, "r1k0w618"),
147
+ className: cx$1(className, "r1k0w618"),
148
148
  ...rest
149
149
  }, /*#__PURE__*/React.createElement("div", {
150
150
  ref: roRef
151
151
  }, width !== undefined && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Canvas, {
152
152
  width: width,
153
153
  height: width,
154
- size: 32
155
- /*descriptor.instances[0].size as number */
156
- ,
154
+ size: 32 /*descriptor.instances[0].size as number */,
157
155
  Component: descriptor.instances[0].Component
158
156
  }), /*#__PURE__*/React.createElement("div", {
159
157
  className: classes.name
160
158
  }, descriptor.name))));
161
159
  }
162
-
163
160
  var Icon$1 = /*#__PURE__*/React.forwardRef(Icon);
164
161
 
165
162
  export { Icon$1 as Icon };
@@ -1,5 +1,7 @@
1
- .n1xsexuc{margin-top:6px;white-space:nowrap;font-size:0.75rem;opacity:0;transition:all 0.16s;z-index:-1;color:var(--timvir-secondary-text-color);text-align:center;user-select:none;pointer-events:none;position:absolute;left:50%;bottom:-20px;transform:translateX(-50%);}
2
- .r1k0w618{position:relative;z-index:1;}.r1k0w618 svg{display:block;}.r1k0w618:hover .n1xsexuc{opacity:1;bottom:-26px;color:var(--timvir-text-color);}.r1k0w618:active .n1xsexuc{bottom:-24px;}
3
1
  .b1a0xzv7{background:white;place-self:stretch;border-radius:2px;transition:all 0.2s;box-shadow:0 0 0 0 rgba(0,0,0,0.1);}
4
2
  .g10obtzp{opacity:0;transition:all 0.2s;pointer-events:none;}
5
3
  .r1bcczis{display:grid;place-items:center;cursor:pointer;}.r1bcczis > *{grid-column:1;grid-row:1;}.r1bcczis:hover .b1a0xzv7{box-shadow:inset 0 0 0 1px rgba(16,22,26,0.2),0 2px 4px rgba(16,22,26,0.1), 0 8px 24px rgba(16,22,26,0.2);}.r1bcczis:active .b1a0xzv7{margin:1px;box-shadow:inset 0 0 0 1px rgba(16,22,26,0.2),0 1px 1px rgba(16,22,26,0.2);}.r1bcczis:hover .g10obtzp{opacity:1;}
4
+
5
+ .n1xsexuc{margin-top:6px;white-space:nowrap;font-size:0.75rem;opacity:0;transition:all 0.16s;z-index:-1;color:var(--timvir-secondary-text-color);text-align:center;user-select:none;pointer-events:none;position:absolute;left:50%;bottom:-20px;transform:translateX(-50%);}
6
+ .r1k0w618{position:relative;z-index:1;}.r1k0w618 svg{display:block;}.r1k0w618:hover .n1xsexuc{opacity:1;bottom:-26px;color:var(--timvir-text-color);}.r1k0w618:active .n1xsexuc{bottom:-24px;}
7
+
@@ -16,33 +16,38 @@ import * as Icons from 'react-feather';
16
16
  * @returns the combined, space separated class names that can be applied directly to the class attribute
17
17
  */
18
18
  const cx = function cx() {
19
- const presentClassNames = Array.prototype.slice.call(arguments).filter(Boolean);
19
+ const presentClassNames = Array.prototype.slice // eslint-disable-next-line prefer-rest-params
20
+ .call(arguments).filter(Boolean);
20
21
  const atomicClasses = {};
21
22
  const nonAtomicClasses = [];
22
-
23
- for (const className of presentClassNames) {
23
+ presentClassNames.forEach(arg => {
24
24
  // className could be the output of a previous cx call, so split by ' ' first
25
- const individualClassNames = className.split(' ');
26
-
27
- for (const className of individualClassNames) {
25
+ const individualClassNames = arg ? arg.split(' ') : [];
26
+ individualClassNames.forEach(className => {
28
27
  if (className.startsWith('atm_')) {
29
28
  const [, keyHash] = className.split('_');
30
29
  atomicClasses[keyHash] = className;
31
30
  } else {
32
31
  nonAtomicClasses.push(className);
33
32
  }
33
+ });
34
+ });
35
+ const result = []; // eslint-disable-next-line no-restricted-syntax
36
+
37
+ for (const keyHash in atomicClasses) {
38
+ if (Object.prototype.hasOwnProperty.call(atomicClasses, keyHash)) {
39
+ result.push(atomicClasses[keyHash]);
34
40
  }
35
41
  }
36
-
37
- return [...Object.values(atomicClasses), ...nonAtomicClasses].join(' ');
42
+ result.push(...nonAtomicClasses);
43
+ return result.join(' ');
38
44
  };
45
+ var cx$1 = cx;
39
46
 
40
47
  /**
41
48
  * The underlying DOM element which is rendered by this component.
42
49
  */
43
-
44
50
  const Root = "div";
45
-
46
51
  function Message(props, ref) {
47
52
  const {
48
53
  variant,
@@ -52,7 +57,7 @@ function Message(props, ref) {
52
57
  } = props;
53
58
  return /*#__PURE__*/React.createElement(Root, {
54
59
  ref: ref,
55
- className: cx(className, "r1ssql2z", variant !== undefined && variantStyles[variant]),
60
+ className: cx$1(className, "r1ssql2z", variant !== undefined && variantStyles[variant]),
56
61
  ...rest
57
62
  }, variant && /*#__PURE__*/React.createElement("div", {
58
63
  className: icon
@@ -70,7 +75,6 @@ function Message(props, ref) {
70
75
  className: "dhvu07f"
71
76
  }, children));
72
77
  }
73
-
74
78
  var Message$1 = /*#__PURE__*/React.forwardRef(Message);
75
79
  const icon = "i1dz18jz";
76
80
  const variantStyles = {
@@ -4,3 +4,4 @@
4
4
  .i41wipx{background:#f0f2fc;color:black;}.i41wipx .i1dz18jz{color:#2a47d5;}
5
5
  .wi7iy6{background:#fcf9f0;color:black;}.wi7iy6 .i1dz18jz{color:#a68521;}
6
6
  .a1d5oxsn{background:#fcf0f0;color:black;}.a1d5oxsn .i1dz18jz{color:#da4444;}
7
+
@@ -16,33 +16,38 @@ import * as React from 'react';
16
16
  * @returns the combined, space separated class names that can be applied directly to the class attribute
17
17
  */
18
18
  const cx = function cx() {
19
- const presentClassNames = Array.prototype.slice.call(arguments).filter(Boolean);
19
+ const presentClassNames = Array.prototype.slice // eslint-disable-next-line prefer-rest-params
20
+ .call(arguments).filter(Boolean);
20
21
  const atomicClasses = {};
21
22
  const nonAtomicClasses = [];
22
-
23
- for (const className of presentClassNames) {
23
+ presentClassNames.forEach(arg => {
24
24
  // className could be the output of a previous cx call, so split by ' ' first
25
- const individualClassNames = className.split(' ');
26
-
27
- for (const className of individualClassNames) {
25
+ const individualClassNames = arg ? arg.split(' ') : [];
26
+ individualClassNames.forEach(className => {
28
27
  if (className.startsWith('atm_')) {
29
28
  const [, keyHash] = className.split('_');
30
29
  atomicClasses[keyHash] = className;
31
30
  } else {
32
31
  nonAtomicClasses.push(className);
33
32
  }
33
+ });
34
+ });
35
+ const result = []; // eslint-disable-next-line no-restricted-syntax
36
+
37
+ for (const keyHash in atomicClasses) {
38
+ if (Object.prototype.hasOwnProperty.call(atomicClasses, keyHash)) {
39
+ result.push(atomicClasses[keyHash]);
34
40
  }
35
41
  }
36
-
37
- return [...Object.values(atomicClasses), ...nonAtomicClasses].join(' ');
42
+ result.push(...nonAtomicClasses);
43
+ return result.join(' ');
38
44
  };
45
+ var cx$1 = cx;
39
46
 
40
47
  /**
41
48
  * The underlying DOM element which is rendered by this component.
42
49
  */
43
-
44
50
  const Root = "div";
45
-
46
51
  function Swatch(props, ref) {
47
52
  const block = useBlock(props);
48
53
  const {
@@ -66,7 +71,7 @@ function Swatch(props, ref) {
66
71
  style: {
67
72
  height: ancestry ? 48 : 36
68
73
  },
69
- className: cx(className, "r19bcggb"),
74
+ className: cx$1(className, "r19bcggb"),
70
75
  onClick: ev => {
71
76
  navigator.clipboard.writeText(value);
72
77
  setLabel("Copied to clipboard");
@@ -88,7 +93,6 @@ function Swatch(props, ref) {
88
93
  className: "dho7t08"
89
94
  }, ancestry)));
90
95
  }
91
-
92
96
  var Swatch$1 = /*#__PURE__*/React.forwardRef(Swatch);
93
97
 
94
98
  export { Swatch$1 as Swatch };
@@ -2,3 +2,4 @@
2
2
  .dhgsgky{display:flex;flex-direction:column;justify-content:center;position:absolute;top:0;right:0;bottom:0;left:0;transition:all 0.16s;padding:0px 12px;cursor:pointer;}
3
3
  .dobecwk{display:flex;justify-content:space-between;align-items:center;line-height:1;}
4
4
  .dho7t08{padding-top:6px;opacity:0.5;font-size:0.8em;line-height:1;}
5
+
@@ -20,26 +20,33 @@ import * as Icons from 'react-feather';
20
20
  * @returns the combined, space separated class names that can be applied directly to the class attribute
21
21
  */
22
22
  const cx = function cx() {
23
- const presentClassNames = Array.prototype.slice.call(arguments).filter(Boolean);
23
+ const presentClassNames = Array.prototype.slice // eslint-disable-next-line prefer-rest-params
24
+ .call(arguments).filter(Boolean);
24
25
  const atomicClasses = {};
25
26
  const nonAtomicClasses = [];
26
-
27
- for (const className of presentClassNames) {
27
+ presentClassNames.forEach(arg => {
28
28
  // className could be the output of a previous cx call, so split by ' ' first
29
- const individualClassNames = className.split(' ');
30
-
31
- for (const className of individualClassNames) {
29
+ const individualClassNames = arg ? arg.split(' ') : [];
30
+ individualClassNames.forEach(className => {
32
31
  if (className.startsWith('atm_')) {
33
32
  const [, keyHash] = className.split('_');
34
33
  atomicClasses[keyHash] = className;
35
34
  } else {
36
35
  nonAtomicClasses.push(className);
37
36
  }
37
+ });
38
+ });
39
+ const result = []; // eslint-disable-next-line no-restricted-syntax
40
+
41
+ for (const keyHash in atomicClasses) {
42
+ if (Object.prototype.hasOwnProperty.call(atomicClasses, keyHash)) {
43
+ result.push(atomicClasses[keyHash]);
38
44
  }
39
45
  }
40
-
41
- return [...Object.values(atomicClasses), ...nonAtomicClasses].join(' ');
46
+ result.push(...nonAtomicClasses);
47
+ return result.join(' ');
42
48
  };
49
+ var cx$1 = cx;
43
50
 
44
51
  function Caption(props) {
45
52
  const components = {
@@ -61,7 +68,6 @@ function Caption(props) {
61
68
  onClick: () => {
62
69
  if (codeRef) {
63
70
  const infoParent = codeRef.parentElement;
64
-
65
71
  if (infoParent.style.height === "0px") {
66
72
  infoParent.style.height = `${codeRef.getBoundingClientRect().height}px`;
67
73
  infoParent.style.opacity = "1";
@@ -74,19 +80,18 @@ function Caption(props) {
74
80
  }, /*#__PURE__*/React.createElement(Icons.Code, {
75
81
  size: "1.6em"
76
82
  }))), code && /*#__PURE__*/React.createElement("div", {
77
- className: cx("d1enfo6"),
83
+ className: cx$1("d1enfo6"),
78
84
  style: {
79
85
  height: 0,
80
86
  opacity: 0
81
87
  }
82
88
  }, /*#__PURE__*/React.createElement("div", {
83
89
  ref: setCodeRef,
84
- className: cx("d1watfn6")
90
+ className: cx$1("d1watfn6")
85
91
  }, /*#__PURE__*/React.createElement(Code, {
86
92
  language: "jsx"
87
93
  }, code))));
88
94
  }
89
-
90
95
  var Caption$1 = /*#__PURE__*/React.memo(Caption);
91
96
 
92
97
  function Handle(props) {
@@ -100,7 +105,6 @@ function Handle(props) {
100
105
  className: "d1mmz2b6",
101
106
  onMouseDown: () => {
102
107
  lock.current = edge;
103
-
104
108
  if (iframeRef.current) {
105
109
  iframeRef.current.style.userSelect = "none";
106
110
  iframeRef.current.style.pointerEvents = "none";
@@ -118,11 +122,9 @@ function Handle(props) {
118
122
  d: "M27 18h2v20h-2V18zm-6 0h2v20h-2V18zm12 0h2v20h-2V18z"
119
123
  })));
120
124
  }
121
-
122
125
  var Handle$1 = /*#__PURE__*/React.memo(Handle);
123
126
 
124
127
  const height = 16;
125
-
126
128
  function Ruler(props) {
127
129
  const {
128
130
  containerWidth = 0,
@@ -157,12 +159,9 @@ function Ruler(props) {
157
159
  /**
158
160
  * The underlying DOM element which is rendered by this component.
159
161
  */
160
-
161
162
  const Root = "div";
162
-
163
163
  function Viewport(props, ref) {
164
164
  var _iframeRef$current, _iframeRef$current$co;
165
-
166
165
  const block = useBlock(props);
167
166
  const {
168
167
  src,
@@ -170,16 +169,16 @@ function Viewport(props, ref) {
170
169
  className,
171
170
  ...rest
172
171
  } = block.props;
172
+
173
173
  /*
174
174
  * The container measures the width of the main column. It is used to initialize
175
175
  * the default width.
176
176
  */
177
-
178
177
  const [containerRef, containerROE] = useResizeObserverEntry();
178
+
179
179
  /*
180
180
  * The SVG spans across the full width. It is used to restrict the max width.
181
181
  */
182
-
183
182
  const [svgRef, svgROE] = useResizeObserverEntry();
184
183
  const [height, setHeight] = React.useState(undefined);
185
184
  const [maxHeight, setMaxHeight] = React.useState(undefined);
@@ -189,7 +188,6 @@ function Viewport(props, ref) {
189
188
  setWidth(svgROE.contentRect.width);
190
189
  } else if (svgROE) {
191
190
  const max = svgROE.contentRect.width - 2 * (56 + 8 + 8);
192
-
193
191
  if (width !== undefined && width > max) {
194
192
  setWidth(max);
195
193
  }
@@ -204,7 +202,6 @@ function Viewport(props, ref) {
204
202
  const max = svgROE.contentRect.width - 2 * (56 + 8 + 8);
205
203
  setWidth(width => {
206
204
  var _left$right$lock$curr;
207
-
208
205
  return Math.min(max, Math.max(320, (width !== null && width !== void 0 ? width : 0) + 2 * ev.movementX * ((_left$right$lock$curr = {
209
206
  left: -1,
210
207
  right: 1
@@ -212,7 +209,6 @@ function Viewport(props, ref) {
212
209
  });
213
210
  }
214
211
  };
215
-
216
212
  const onMouseUp = () => {
217
213
  lock.current = "";
218
214
  iframeRef.current.style.userSelect = "";
@@ -222,7 +218,6 @@ function Viewport(props, ref) {
222
218
  return height;
223
219
  });
224
220
  };
225
-
226
221
  window.addEventListener("mousemove", onMouseMove);
227
222
  window.addEventListener("mouseup", onMouseUp);
228
223
  return () => {
@@ -237,6 +232,7 @@ function Viewport(props, ref) {
237
232
  setMaxHeight(Math.max(height, maxHeight !== null && maxHeight !== void 0 ? maxHeight : 0));
238
233
  }
239
234
  });
235
+
240
236
  /*
241
237
  * The <html> element of the iframe document is the one which we observe and
242
238
  * measure. We do not use <body> because that may have margins around which would
@@ -245,7 +241,6 @@ function Viewport(props, ref) {
245
241
  * We hope that nobody intentionally adds margins around the <html> element. By default
246
242
  * it doesn't have.
247
243
  */
248
-
249
244
  const html = (_iframeRef$current = iframeRef.current) === null || _iframeRef$current === void 0 ? void 0 : (_iframeRef$current$co = _iframeRef$current.contentDocument) === null || _iframeRef$current$co === void 0 ? void 0 : _iframeRef$current$co.querySelector("html");
250
245
  React.useEffect(() => {
251
246
  if (html) {
@@ -257,7 +252,7 @@ function Viewport(props, ref) {
257
252
  }), /*#__PURE__*/React.createElement(Root, {
258
253
  ref: ref,
259
254
  ...rest,
260
- className: cx(className, fullWidth, "r1ouu0bc")
255
+ className: cx$1(className, fullWidth, "r1ouu0bc")
261
256
  }, /*#__PURE__*/React.createElement("div", {
262
257
  ref: svgRef,
263
258
  className: "d1uj09ka"
@@ -271,7 +266,7 @@ function Viewport(props, ref) {
271
266
  }, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
272
267
  className: "d17q9rbm"
273
268
  }, /*#__PURE__*/React.createElement("div", {
274
- className: cx("daubpa6", height === undefined && "d1d22s19"),
269
+ className: cx$1("daubpa6", height === undefined && "d1d22s19"),
275
270
  style: {
276
271
  width,
277
272
  height
@@ -282,14 +277,12 @@ function Viewport(props, ref) {
282
277
  src: src,
283
278
  onLoad: () => {
284
279
  var _iframeRef$current2, _iframeRef$current2$c;
285
-
286
280
  /*
287
281
  * Once the iframe has loaded, initialize the height/maxHeight.
288
282
  * The <html> element may not exist though (eg. the page failed
289
283
  * to load, or it's not a HTML page).
290
284
  */
291
285
  const html = (_iframeRef$current2 = iframeRef.current) === null || _iframeRef$current2 === void 0 ? void 0 : (_iframeRef$current2$c = _iframeRef$current2.contentDocument) === null || _iframeRef$current2$c === void 0 ? void 0 : _iframeRef$current2$c.querySelector("html");
292
-
293
286
  if (html) {
294
287
  const {
295
288
  height
@@ -326,7 +319,6 @@ function Viewport(props, ref) {
326
319
  }
327
320
  }));
328
321
  }
329
-
330
322
  var Viewport$1 = /*#__PURE__*/React.forwardRef(Viewport);
331
323
 
332
324
  export { Viewport$1 as Viewport };
@@ -1,3 +1,12 @@
1
+ .fgdj0yb{font-size:0.75rem;color:var(--timvir-secondary-text-color);white-space:nowrap;display:flex;justify-content:space-between;align-items:center;}
2
+ .d1rc4zjh{cursor:pointer;}.d1rc4zjh:hover{color:var(--c-p-4);opacity:1;}.d1rc4zjh > svg{display:block;}
3
+ .d1enfo6{overflow:hidden;transition:height 0.2s,opacity 0.2s 0.1s;}
4
+ .d1watfn6{margin-top:12px;}
5
+
6
+ .d1mmz2b6{grid-row:1 / span 3;cursor:pointer;display:flex;align-items:center;justify-content:center;opacity:0.5;color:var(--timvir-text-color);border-radius:2px;transition:all 0.2s cubic-bezier(0.4,1,0.75,0.9);}.d1mmz2b6:hover{opacity:1;box-shadow:0 0 0 1px rgba(16,22,26,0.1),0 2px 4px rgba(16,22,26,0.2),0 8px 24px rgba(16,22,26,0.2);}.d1mmz2b6:active{box-shadow:0 0 0 1px rgba(16,22,26,0.1),0 0 0 rgba(16,22,26,0),0 1px 1px rgba(16,22,26,0.2);}
7
+
8
+ .ssl4j8q{width:100%;display:block;height:16px;margin:8px 0;}
9
+
1
10
  .r1ouu0bc{contain:layout;}
2
11
  .d1uj09ka{position:relative;}
3
12
  .d2uawyc{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);}
@@ -6,9 +15,4 @@
6
15
  .daubpa6{grid-column:2 / span 1;grid-row:2 / span 1;position:relative;flex:1;height:100px;background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAoAAAAKCAAAAACoWZBhAAAAF0lEQVQI12P4BAI/QICBFCaYBPNJYQIAkUZftTbC4sIAAAAASUVORK5CYII=);transition:height 0.16s;overflow:hidden;}
7
16
  .d1d22s19{animation-duration:2s;animation-fill-mode:forwards;animation-iteration-count:infinite;animation-name:shimmer-d1d22s19;animation-timing-function:linear;background-size:150vw 100px;background-image:linear-gradient(to right,#fafafa 0%,#f4f4f4 25%,#fafafa 40%);box-shadow:inset 0 0 0 1px rgba(16,22,26,0.2);border-radius:1px;}@keyframes shimmer-d1d22s19{0%{background-position:-60vw 0;}40%{background-position:85vw 0;}100%{background-position:85vw 0;}}
8
17
  .i11uos8q{display:block;position:absolute;top:0;left:0;width:100%;height:100%;transition:opacity 0.2s;}
9
- .fgdj0yb{font-size:0.75rem;color:var(--timvir-secondary-text-color);white-space:nowrap;display:flex;justify-content:space-between;align-items:center;}
10
- .d1rc4zjh{cursor:pointer;}.d1rc4zjh:hover{color:var(--c-p-4);opacity:1;}.d1rc4zjh > svg{display:block;}
11
- .d1enfo6{overflow:hidden;transition:height 0.2s,opacity 0.2s 0.1s;}
12
- .d1watfn6{margin-top:12px;}
13
- .d1mmz2b6{grid-row:1 / span 3;cursor:pointer;display:flex;align-items:center;justify-content:center;opacity:0.5;color:var(--timvir-text-color);border-radius:2px;transition:all 0.2s cubic-bezier(0.4,1,0.75,0.9);}.d1mmz2b6:hover{opacity:1;box-shadow:0 0 0 1px rgba(16,22,26,0.1),0 2px 4px rgba(16,22,26,0.2),0 8px 24px rgba(16,22,26,0.2);}.d1mmz2b6:active{box-shadow:0 0 0 1px rgba(16,22,26,0.1),0 0 0 rgba(16,22,26,0),0 1px 1px rgba(16,22,26,0.2);}
14
- .ssl4j8q{width:100%;display:block;height:16px;margin:8px 0;}
18
+