timvir 0.2.10 → 0.2.11
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/Code/Code.d.ts +1 -2
- package/blocks/Code/index.js +1 -2
- package/blocks/Code/samples/toggle.d.ts +1 -0
- package/blocks/ColorBar/samples/basic.d.ts +1 -0
- package/blocks/ColorBook/samples/basic.d.ts +1 -0
- package/blocks/Cover/samples/basic.d.ts +1 -0
- package/blocks/Exhibit/samples/basic.d.ts +1 -0
- package/blocks/Font/samples/system.d.ts +1 -0
- package/blocks/Grid/samples/basic.d.ts +1 -0
- package/blocks/Icon/samples/basic.d.ts +1 -0
- package/blocks/Swatch/samples/basic.d.ts +1 -0
- package/blocks/Viewport/internal/Ruler.d.ts +1 -0
- package/blocks/Viewport/samples/basic.d.ts +1 -0
- package/core/components/Commands/internal/Dialog.d.ts +1 -0
- package/core/components/Page/internal/Section.d.ts +1 -0
- package/core/components/Page/samples/basic.d.ts +1 -0
- package/core/components/Page/samples/layout.d.ts +1 -0
- package/core/index.js +9 -3
- package/package.json +2 -2
- package/search/Search/internal/Highlight.d.ts +1 -0
- package/search/Search/samples/basic.d.ts +1 -0
- package/search/SearchBoxInput/samples/basic.d.ts +1 -0
- package/search/SearchBoxListItem/samples/basic.d.ts +1 -0
package/blocks/Code/Code.d.ts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This is documentation for the Code component.
|
|
3
3
|
*/
|
|
4
|
-
import { Language } from "prism-react-renderer";
|
|
5
4
|
import * as React from "react";
|
|
6
5
|
/**
|
|
7
6
|
* The underlying DOM element which is rendered by this component.
|
|
@@ -17,7 +16,7 @@ interface Props extends React.ComponentPropsWithoutRef<typeof Root> {
|
|
|
17
16
|
*
|
|
18
17
|
* @default "markup"
|
|
19
18
|
*/
|
|
20
|
-
language?:
|
|
19
|
+
language?: string;
|
|
21
20
|
/**
|
|
22
21
|
* When set, the code block spans the full width. Note that the text itself
|
|
23
22
|
* is still aligned with the main column. Use this when you expect the text
|
package/blocks/Code/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as Page from 'timvir/core';
|
|
2
2
|
import { useBlock } from 'timvir/core';
|
|
3
|
-
import
|
|
3
|
+
import { Highlight } from 'prism-react-renderer';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import * as Icons from 'react-feather';
|
|
6
6
|
import { useImmer } from 'use-immer';
|
|
@@ -70,7 +70,6 @@ function Code(props, ref) {
|
|
|
70
70
|
className: cx_default(classes.root, fullWidth && Page.fullWidth),
|
|
71
71
|
...rest
|
|
72
72
|
}, /*#__PURE__*/React.createElement(Highlight, {
|
|
73
|
-
...defaultProps,
|
|
74
73
|
code: children.trim(),
|
|
75
74
|
language: language !== null && language !== void 0 ? language : "markup",
|
|
76
75
|
theme: nullTheme
|
package/core/index.js
CHANGED
|
@@ -416,9 +416,15 @@ var warnIfInvalid = (value, componentName) => {
|
|
|
416
416
|
);
|
|
417
417
|
}
|
|
418
418
|
};
|
|
419
|
+
var idx = 0;
|
|
419
420
|
function styled(tag) {
|
|
421
|
+
var _a;
|
|
422
|
+
let mockedClass = `mocked-styled-${idx++}`;
|
|
423
|
+
if ((_a = tag == null ? void 0 : tag.__linaria) == null ? void 0 : _a.className) {
|
|
424
|
+
mockedClass += ` ${tag.__linaria.className}`;
|
|
425
|
+
}
|
|
420
426
|
return (options) => {
|
|
421
|
-
if (process.env.NODE_ENV !== "production") {
|
|
427
|
+
if (process.env.NODE_ENV !== "production" && process.env.NODE_ENV !== "test") {
|
|
422
428
|
if (Array.isArray(options)) {
|
|
423
429
|
throw new Error(
|
|
424
430
|
'Using the "styled" tag in runtime is not supported. Make sure you have set up the Babel plugin correctly. See https://github.com/callstack/linaria#setup'
|
|
@@ -426,7 +432,7 @@ function styled(tag) {
|
|
|
426
432
|
}
|
|
427
433
|
}
|
|
428
434
|
const render = (props, ref) => {
|
|
429
|
-
const { as: component = tag, class: className } = props;
|
|
435
|
+
const { as: component = tag, class: className = mockedClass } = props;
|
|
430
436
|
const shouldKeepProps = options.propsAsIs === void 0 ? !(typeof component === "string" && component.indexOf("-") === -1 && !isCapital(component[0])) : options.propsAsIs;
|
|
431
437
|
const filteredProps = filterProps(shouldKeepProps, props, [
|
|
432
438
|
"as",
|
|
@@ -466,7 +472,7 @@ function styled(tag) {
|
|
|
466
472
|
};
|
|
467
473
|
Result.displayName = options.name;
|
|
468
474
|
Result.__linaria = {
|
|
469
|
-
className: options.class,
|
|
475
|
+
className: options.class ?? mockedClass,
|
|
470
476
|
extends: tag
|
|
471
477
|
};
|
|
472
478
|
return Result;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"type": "module",
|
|
3
3
|
"name": "timvir",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.11",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"exports": {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"downshift": "^7",
|
|
20
20
|
"fuzzaldrin-plus": "^0.6.0",
|
|
21
21
|
"immer": "^9 || ^10",
|
|
22
|
-
"prism-react-renderer": "^
|
|
22
|
+
"prism-react-renderer": "^2",
|
|
23
23
|
"react-feather": "^2",
|
|
24
24
|
"use-immer": "^0.8.0 || ^0.8.1 || ^0.9.0",
|
|
25
25
|
"wonka": "^6"
|