timvir 0.1.47 → 0.2.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/blocks/Arbitrary/Arbitrary.d.ts +1 -1
- package/blocks/Arbitrary/index.js +20 -10
- package/blocks/Code/index.js +19 -9
- package/blocks/ColorBar/index.js +19 -9
- package/blocks/ColorBook/index.js +19 -9
- package/blocks/Cover/index.js +19 -9
- package/blocks/Exhibit/Exhibit.d.ts +1 -1
- package/blocks/Exhibit/index.js +19 -9
- package/blocks/Font/index.js +19 -9
- package/blocks/Grid/Grid.d.ts +1 -1
- package/blocks/Grid/index.js +21 -11
- package/blocks/Icon/Icon.d.ts +1 -1
- package/blocks/Icon/index.js +19 -9
- package/blocks/Message/index.js +19 -9
- package/blocks/Swatch/index.js +19 -9
- package/blocks/Viewport/index.js +19 -9
- package/blocks/WebLink/index.js +19 -9
- package/context/index.d.ts +2 -0
- package/core/components/Commands/Commands.d.ts +5 -0
- package/core/components/Commands/index.d.ts +1 -0
- package/core/components/Commands/internal/Action.d.ts +7 -0
- package/core/components/Commands/internal/Dialog.d.ts +8 -0
- package/core/components/Commands/internal/index.d.ts +2 -0
- package/core/components/Page/Page.d.ts +1 -1
- package/core/index.js +14910 -215
- package/core/layout.d.ts +2 -2
- package/core/styles.css +9 -0
- package/package.json +2 -2
- package/search/Search/docs/index.mdx +1 -1
- package/search/SearchBoxInput/SearchBoxInput.d.ts +1 -1
- package/search/SearchBoxListItem/SearchBoxListItem.d.ts +1 -1
- package/search/SearchBoxListItem/docs/index.mdx +1 -1
- package/search/index.js +19 -9
- package/styles.css +9 -0
package/blocks/Message/index.js
CHANGED
|
@@ -7,24 +7,34 @@ import * as Icons from 'react-feather';
|
|
|
7
7
|
* ```js
|
|
8
8
|
* cx('red', isBig && 'big') // returns 'red big' if `isBig` is true, otherwise returns 'red'
|
|
9
9
|
* ```
|
|
10
|
-
* If
|
|
10
|
+
* If space separated atomic styles are provided, they are deduplicated according to the first hashed valued:
|
|
11
11
|
*
|
|
12
12
|
* ```js
|
|
13
|
-
* cx(
|
|
13
|
+
* cx('atm_a_class1 atm_b_class2', 'atm_a_class3') // returns `atm_a_class3 atm_b_class2`
|
|
14
14
|
* ```
|
|
15
15
|
*
|
|
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.call(arguments).filter(Boolean);
|
|
20
|
+
const atomicClasses = {};
|
|
21
|
+
const nonAtomicClasses = [];
|
|
20
22
|
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
// the class names
|
|
23
|
+
for (const className of presentClassNames) {
|
|
24
|
+
// className could be the output of a previous cx call, so split by ' ' first
|
|
25
|
+
const individualClassNames = className.split(' ');
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
for (const className of individualClassNames) {
|
|
28
|
+
if (className.startsWith('atm_')) {
|
|
29
|
+
const [, keyHash] = className.split('_');
|
|
30
|
+
atomicClasses[keyHash] = className;
|
|
31
|
+
} else {
|
|
32
|
+
nonAtomicClasses.push(className);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return [...Object.values(atomicClasses), ...nonAtomicClasses].join(' ');
|
|
28
38
|
};
|
|
29
39
|
|
|
30
40
|
/**
|
package/blocks/Swatch/index.js
CHANGED
|
@@ -7,24 +7,34 @@ import * as React from 'react';
|
|
|
7
7
|
* ```js
|
|
8
8
|
* cx('red', isBig && 'big') // returns 'red big' if `isBig` is true, otherwise returns 'red'
|
|
9
9
|
* ```
|
|
10
|
-
* If
|
|
10
|
+
* If space separated atomic styles are provided, they are deduplicated according to the first hashed valued:
|
|
11
11
|
*
|
|
12
12
|
* ```js
|
|
13
|
-
* cx(
|
|
13
|
+
* cx('atm_a_class1 atm_b_class2', 'atm_a_class3') // returns `atm_a_class3 atm_b_class2`
|
|
14
14
|
* ```
|
|
15
15
|
*
|
|
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.call(arguments).filter(Boolean);
|
|
20
|
+
const atomicClasses = {};
|
|
21
|
+
const nonAtomicClasses = [];
|
|
20
22
|
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
// the class names
|
|
23
|
+
for (const className of presentClassNames) {
|
|
24
|
+
// className could be the output of a previous cx call, so split by ' ' first
|
|
25
|
+
const individualClassNames = className.split(' ');
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
for (const className of individualClassNames) {
|
|
28
|
+
if (className.startsWith('atm_')) {
|
|
29
|
+
const [, keyHash] = className.split('_');
|
|
30
|
+
atomicClasses[keyHash] = className;
|
|
31
|
+
} else {
|
|
32
|
+
nonAtomicClasses.push(className);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return [...Object.values(atomicClasses), ...nonAtomicClasses].join(' ');
|
|
28
38
|
};
|
|
29
39
|
|
|
30
40
|
/**
|
package/blocks/Viewport/index.js
CHANGED
|
@@ -11,24 +11,34 @@ import * as Icons from 'react-feather';
|
|
|
11
11
|
* ```js
|
|
12
12
|
* cx('red', isBig && 'big') // returns 'red big' if `isBig` is true, otherwise returns 'red'
|
|
13
13
|
* ```
|
|
14
|
-
* If
|
|
14
|
+
* If space separated atomic styles are provided, they are deduplicated according to the first hashed valued:
|
|
15
15
|
*
|
|
16
16
|
* ```js
|
|
17
|
-
* cx(
|
|
17
|
+
* cx('atm_a_class1 atm_b_class2', 'atm_a_class3') // returns `atm_a_class3 atm_b_class2`
|
|
18
18
|
* ```
|
|
19
19
|
*
|
|
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.call(arguments).filter(Boolean);
|
|
24
|
+
const atomicClasses = {};
|
|
25
|
+
const nonAtomicClasses = [];
|
|
24
26
|
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
// the class names
|
|
27
|
+
for (const className of presentClassNames) {
|
|
28
|
+
// className could be the output of a previous cx call, so split by ' ' first
|
|
29
|
+
const individualClassNames = className.split(' ');
|
|
29
30
|
|
|
30
|
-
|
|
31
|
-
|
|
31
|
+
for (const className of individualClassNames) {
|
|
32
|
+
if (className.startsWith('atm_')) {
|
|
33
|
+
const [, keyHash] = className.split('_');
|
|
34
|
+
atomicClasses[keyHash] = className;
|
|
35
|
+
} else {
|
|
36
|
+
nonAtomicClasses.push(className);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
return [...Object.values(atomicClasses), ...nonAtomicClasses].join(' ');
|
|
32
42
|
};
|
|
33
43
|
|
|
34
44
|
function Caption(props) {
|
package/blocks/WebLink/index.js
CHANGED
|
@@ -7,24 +7,34 @@ import { useContext } from 'timvir/core';
|
|
|
7
7
|
* ```js
|
|
8
8
|
* cx('red', isBig && 'big') // returns 'red big' if `isBig` is true, otherwise returns 'red'
|
|
9
9
|
* ```
|
|
10
|
-
* If
|
|
10
|
+
* If space separated atomic styles are provided, they are deduplicated according to the first hashed valued:
|
|
11
11
|
*
|
|
12
12
|
* ```js
|
|
13
|
-
* cx(
|
|
13
|
+
* cx('atm_a_class1 atm_b_class2', 'atm_a_class3') // returns `atm_a_class3 atm_b_class2`
|
|
14
14
|
* ```
|
|
15
15
|
*
|
|
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.call(arguments).filter(Boolean);
|
|
20
|
+
const atomicClasses = {};
|
|
21
|
+
const nonAtomicClasses = [];
|
|
20
22
|
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
// the class names
|
|
23
|
+
for (const className of presentClassNames) {
|
|
24
|
+
// className could be the output of a previous cx call, so split by ' ' first
|
|
25
|
+
const individualClassNames = className.split(' ');
|
|
25
26
|
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
for (const className of individualClassNames) {
|
|
28
|
+
if (className.startsWith('atm_')) {
|
|
29
|
+
const [, keyHash] = className.split('_');
|
|
30
|
+
atomicClasses[keyHash] = className;
|
|
31
|
+
} else {
|
|
32
|
+
nonAtomicClasses.push(className);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return [...Object.values(atomicClasses), ...nonAtomicClasses].join(' ');
|
|
28
38
|
};
|
|
29
39
|
|
|
30
40
|
/**
|
package/context/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import { Bus } from "timvir/bus";
|
|
3
|
+
import { Node } from "../core/components/Page/types";
|
|
3
4
|
export interface Value {
|
|
4
5
|
bus: Bus;
|
|
5
6
|
location: {
|
|
@@ -15,6 +16,7 @@ export interface Value {
|
|
|
15
16
|
unfurl: (url: string) => Promise<any>;
|
|
16
17
|
};
|
|
17
18
|
};
|
|
19
|
+
toc: readonly Node[];
|
|
18
20
|
}
|
|
19
21
|
export declare const Provider: React.Provider<Value | undefined>;
|
|
20
22
|
export declare function useContext(): Value;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Commands } from "./Commands";
|
|
@@ -56,5 +56,5 @@ interface Props extends React.ComponentProps<typeof Root> {
|
|
|
56
56
|
*/
|
|
57
57
|
blocks?: Value["blocks"];
|
|
58
58
|
}
|
|
59
|
-
declare const _default: React.ForwardRefExoticComponent<Pick<Props, "
|
|
59
|
+
declare const _default: React.ForwardRefExoticComponent<Pick<Props, "hidden" | "color" | "style" | "translate" | "prefix" | "slot" | "title" | "search" | "key" | "defaultChecked" | "defaultValue" | "suppressContentEditableWarning" | "suppressHydrationWarning" | "accessKey" | "className" | "contentEditable" | "contextMenu" | "dir" | "draggable" | "id" | "lang" | "placeholder" | "spellCheck" | "tabIndex" | "radioGroup" | "role" | "about" | "datatype" | "inlist" | "property" | "resource" | "typeof" | "vocab" | "autoCapitalize" | "autoCorrect" | "autoSave" | "itemProp" | "itemScope" | "itemType" | "itemID" | "itemRef" | "results" | "security" | "unselectable" | "inputMode" | "is" | "aria-activedescendant" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colspan" | "aria-controls" | "aria-current" | "aria-describedby" | "aria-details" | "aria-disabled" | "aria-dropeffect" | "aria-errormessage" | "aria-expanded" | "aria-flowto" | "aria-grabbed" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-labelledby" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-owns" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-relevant" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext" | "children" | "dangerouslySetInnerHTML" | "onCopy" | "onCopyCapture" | "onCut" | "onCutCapture" | "onPaste" | "onPasteCapture" | "onCompositionEnd" | "onCompositionEndCapture" | "onCompositionStart" | "onCompositionStartCapture" | "onCompositionUpdate" | "onCompositionUpdateCapture" | "onFocus" | "onFocusCapture" | "onBlur" | "onBlurCapture" | "onChange" | "onChangeCapture" | "onBeforeInput" | "onBeforeInputCapture" | "onInput" | "onInputCapture" | "onReset" | "onResetCapture" | "onSubmit" | "onSubmitCapture" | "onInvalid" | "onInvalidCapture" | "onLoad" | "onLoadCapture" | "onError" | "onErrorCapture" | "onKeyDown" | "onKeyDownCapture" | "onKeyPress" | "onKeyPressCapture" | "onKeyUp" | "onKeyUpCapture" | "onAbort" | "onAbortCapture" | "onCanPlay" | "onCanPlayCapture" | "onCanPlayThrough" | "onCanPlayThroughCapture" | "onDurationChange" | "onDurationChangeCapture" | "onEmptied" | "onEmptiedCapture" | "onEncrypted" | "onEncryptedCapture" | "onEnded" | "onEndedCapture" | "onLoadedData" | "onLoadedDataCapture" | "onLoadedMetadata" | "onLoadedMetadataCapture" | "onLoadStart" | "onLoadStartCapture" | "onPause" | "onPauseCapture" | "onPlay" | "onPlayCapture" | "onPlaying" | "onPlayingCapture" | "onProgress" | "onProgressCapture" | "onRateChange" | "onRateChangeCapture" | "onSeeked" | "onSeekedCapture" | "onSeeking" | "onSeekingCapture" | "onStalled" | "onStalledCapture" | "onSuspend" | "onSuspendCapture" | "onTimeUpdate" | "onTimeUpdateCapture" | "onVolumeChange" | "onVolumeChangeCapture" | "onWaiting" | "onWaitingCapture" | "onAuxClick" | "onAuxClickCapture" | "onClick" | "onClickCapture" | "onContextMenu" | "onContextMenuCapture" | "onDoubleClick" | "onDoubleClickCapture" | "onDrag" | "onDragCapture" | "onDragEnd" | "onDragEndCapture" | "onDragEnter" | "onDragEnterCapture" | "onDragExit" | "onDragExitCapture" | "onDragLeave" | "onDragLeaveCapture" | "onDragOver" | "onDragOverCapture" | "onDragStart" | "onDragStartCapture" | "onDrop" | "onDropCapture" | "onMouseDown" | "onMouseDownCapture" | "onMouseEnter" | "onMouseLeave" | "onMouseMove" | "onMouseMoveCapture" | "onMouseOut" | "onMouseOutCapture" | "onMouseOver" | "onMouseOverCapture" | "onMouseUp" | "onMouseUpCapture" | "onSelect" | "onSelectCapture" | "onTouchCancel" | "onTouchCancelCapture" | "onTouchEnd" | "onTouchEndCapture" | "onTouchMove" | "onTouchMoveCapture" | "onTouchStart" | "onTouchStartCapture" | "onPointerDown" | "onPointerDownCapture" | "onPointerMove" | "onPointerMoveCapture" | "onPointerUp" | "onPointerUpCapture" | "onPointerCancel" | "onPointerCancelCapture" | "onPointerEnter" | "onPointerEnterCapture" | "onPointerLeave" | "onPointerLeaveCapture" | "onPointerOver" | "onPointerOverCapture" | "onPointerOut" | "onPointerOutCapture" | "onGotPointerCapture" | "onGotPointerCaptureCapture" | "onLostPointerCapture" | "onLostPointerCaptureCapture" | "onScroll" | "onScrollCapture" | "onWheel" | "onWheelCapture" | "onAnimationStart" | "onAnimationStartCapture" | "onAnimationEnd" | "onAnimationEndCapture" | "onAnimationIteration" | "onAnimationIterationCapture" | "onTransitionEnd" | "onTransitionEndCapture" | "location" | "Link" | "toc" | "mdxComponents" | "Footer" | "blocks"> & React.RefAttributes<HTMLDivElement>>;
|
|
60
60
|
export default _default;
|