fontdue-js 0.1.1 → 1.0.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/CharacterViewer.d.ts +3 -0
- package/CharacterViewer.js +1 -0
- package/README.md +37 -25
- package/dist/__generated__/CharacterViewer_SlugQuery.graphql.d.ts +20 -0
- package/dist/__generated__/CharacterViewer_SlugQuery.graphql.js +289 -0
- package/dist/__generated__/TypeTesterStandalone_StyleQuery.graphql.d.ts +6 -0
- package/dist/__generated__/TypeTesterStandalone_StyleQuery.graphql.js +32 -4
- package/dist/components/Cart/CustomerFields.d.ts +14 -0
- package/dist/components/Cart/CustomerFields.js +4 -5
- package/dist/components/CharacterViewer/index.d.ts +2 -1
- package/dist/components/CharacterViewer/index.js +47 -21
- package/dist/components/Checkbox/index.js +4 -5
- package/dist/components/ConfigContext.d.ts +78 -1
- package/dist/components/ConfigContext.js +52 -2
- package/dist/components/FontdueProvider/index.js +2 -2
- package/dist/components/SelectButton/index.js +1 -3
- package/dist/components/StoreModal/StoreModalIndex.js +6 -5
- package/dist/components/StoreModalProductLicenseSelection/LicenseElement.js +4 -5
- package/dist/components/TypeTester/TypeTesterEditAll.d.ts +0 -2
- package/dist/components/TypeTester/TypeTesterEditAll.js +6 -4
- package/dist/components/TypeTester/TypeTesterFeatures.d.ts +0 -2
- package/dist/components/TypeTester/TypeTesterFeatures.js +11 -6
- package/dist/components/TypeTester/TypeTesterFloatingToolbar.js +3 -5
- package/dist/components/TypeTester/TypeTesterStandalone.js +3 -3
- package/dist/components/TypeTester/TypeTesterState.js +1 -3
- package/dist/components/TypeTester/TypeTesterStyleSelect.js +0 -2
- package/dist/components/TypeTester/TypeTesterToolbar.d.ts +0 -2
- package/dist/components/TypeTester/TypeTesterToolbar.js +15 -13
- package/dist/components/TypeTester/index.d.ts +2 -1
- package/dist/components/TypeTester/index.js +12 -26
- package/dist/components/TypeTesters/index.js +7 -10
- package/dist/components/elements/StoreModalReviewConfirm/index.js +4 -5
- package/fontdue.css +4 -0
- package/fontdue.css.map +1 -1
- package/package.json +1 -1
|
@@ -20,17 +20,16 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
20
20
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
21
21
|
|
|
22
22
|
const Checkbox = props => {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
const checkboxStyle = (_config$form$checkbox = (_config$form = config.form) === null || _config$form === void 0 ? void 0 : _config$form.checkboxStyle) !== null && _config$form$checkbox !== void 0 ? _config$form$checkbox : 'check';
|
|
23
|
+
const {
|
|
24
|
+
form: config
|
|
25
|
+
} = (0, _react.useContext)(_ConfigContext.default);
|
|
27
26
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
28
27
|
className: "checkbox"
|
|
29
28
|
}, /*#__PURE__*/_react.default.createElement("input", _extends({
|
|
30
29
|
type: "checkbox"
|
|
31
30
|
}, props)), /*#__PURE__*/_react.default.createElement("div", {
|
|
32
31
|
className: "checkbox__icon"
|
|
33
|
-
}, checkboxStyle === 'check' ? /*#__PURE__*/_react.default.createElement(_Icons.Check, null) : /*#__PURE__*/_react.default.createElement(_Icons.X, null)));
|
|
32
|
+
}, config.checkboxStyle === 'check' ? /*#__PURE__*/_react.default.createElement(_Icons.Check, null) : /*#__PURE__*/_react.default.createElement(_Icons.X, null)));
|
|
34
33
|
};
|
|
35
34
|
|
|
36
35
|
var _default = Checkbox;
|
|
@@ -9,5 +9,82 @@ export interface Config {
|
|
|
9
9
|
storeModal?: StoreModalConfig;
|
|
10
10
|
typeTester?: TypeTesterConfig;
|
|
11
11
|
}
|
|
12
|
-
declare const
|
|
12
|
+
export declare const makeConfig: (config?: Config | undefined) => {
|
|
13
|
+
typeTester: {
|
|
14
|
+
min: number;
|
|
15
|
+
max: number;
|
|
16
|
+
autofitOnChange: boolean;
|
|
17
|
+
truncate: boolean;
|
|
18
|
+
priceText: boolean;
|
|
19
|
+
selectButtonStyle: "inline" | "outlined";
|
|
20
|
+
selectButtonLabel: string;
|
|
21
|
+
selectButton: boolean;
|
|
22
|
+
shy: false | "focus" | "hover";
|
|
23
|
+
toolsPosition: "inline" | "floating";
|
|
24
|
+
selectable: boolean;
|
|
25
|
+
priceBar: boolean;
|
|
26
|
+
textInput: boolean;
|
|
27
|
+
initialMode: "group" | "local";
|
|
28
|
+
groupEdit: boolean;
|
|
29
|
+
bulletStyle: "square" | "round";
|
|
30
|
+
openTypeFeatures: {
|
|
31
|
+
columns: {
|
|
32
|
+
features: (string | {
|
|
33
|
+
code: string;
|
|
34
|
+
name: string;
|
|
35
|
+
})[];
|
|
36
|
+
range?: number | undefined;
|
|
37
|
+
}[] | undefined;
|
|
38
|
+
selectionStyle: "checkbox" | "bullet";
|
|
39
|
+
};
|
|
40
|
+
alignmentButtons: boolean;
|
|
41
|
+
initialAlignment: import("./TypeTester/types").Alignment;
|
|
42
|
+
};
|
|
43
|
+
form: {
|
|
44
|
+
checkboxStyle: "cross" | "check";
|
|
45
|
+
};
|
|
46
|
+
storeModal: {
|
|
47
|
+
indexLayout: "styled-aa" | "styled-font-names";
|
|
48
|
+
productLicensesPosition: "bottom" | "top";
|
|
49
|
+
};
|
|
50
|
+
};
|
|
51
|
+
declare const _default: React.Context<{
|
|
52
|
+
typeTester: {
|
|
53
|
+
min: number;
|
|
54
|
+
max: number;
|
|
55
|
+
autofitOnChange: boolean;
|
|
56
|
+
truncate: boolean;
|
|
57
|
+
priceText: boolean;
|
|
58
|
+
selectButtonStyle: "inline" | "outlined";
|
|
59
|
+
selectButtonLabel: string;
|
|
60
|
+
selectButton: boolean;
|
|
61
|
+
shy: false | "focus" | "hover";
|
|
62
|
+
toolsPosition: "inline" | "floating";
|
|
63
|
+
selectable: boolean;
|
|
64
|
+
priceBar: boolean;
|
|
65
|
+
textInput: boolean;
|
|
66
|
+
initialMode: "group" | "local";
|
|
67
|
+
groupEdit: boolean;
|
|
68
|
+
bulletStyle: "square" | "round";
|
|
69
|
+
openTypeFeatures: {
|
|
70
|
+
columns: {
|
|
71
|
+
features: (string | {
|
|
72
|
+
code: string;
|
|
73
|
+
name: string;
|
|
74
|
+
})[];
|
|
75
|
+
range?: number | undefined;
|
|
76
|
+
}[] | undefined;
|
|
77
|
+
selectionStyle: "checkbox" | "bullet";
|
|
78
|
+
};
|
|
79
|
+
alignmentButtons: boolean;
|
|
80
|
+
initialAlignment: import("./TypeTester/types").Alignment;
|
|
81
|
+
};
|
|
82
|
+
form: {
|
|
83
|
+
checkboxStyle: "cross" | "check";
|
|
84
|
+
};
|
|
85
|
+
storeModal: {
|
|
86
|
+
indexLayout: "styled-aa" | "styled-font-names";
|
|
87
|
+
productLicensesPosition: "bottom" | "top";
|
|
88
|
+
};
|
|
89
|
+
}>;
|
|
13
90
|
export default _default;
|
|
@@ -3,12 +3,62 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.default = void 0;
|
|
6
|
+
exports.makeConfig = exports.default = void 0;
|
|
7
7
|
|
|
8
8
|
var _react = _interopRequireDefault(require("react"));
|
|
9
9
|
|
|
10
10
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
11
11
|
|
|
12
|
-
|
|
12
|
+
const makeTypeTesterConfig = config => {
|
|
13
|
+
var _config$shy, _config$toolsPosition, _config$min, _config$max, _config$autofitOnChan, _config$truncate, _config$priceText, _config$selectButtonS, _config$selectButtonL, _ref, _config$selectButton, _config$selectable, _config$priceBar, _config$textInput, _config$initialMode, _config$groupEdit, _config$bulletStyle, _config$openTypeFeatu, _config$openTypeFeatu2, _config$openTypeFeatu3, _config$alignmentButt, _config$initialAlignm;
|
|
14
|
+
|
|
15
|
+
let shy = (_config$shy = config === null || config === void 0 ? void 0 : config.shy) !== null && _config$shy !== void 0 ? _config$shy : false;
|
|
16
|
+
if (shy === true) shy = 'hover';
|
|
17
|
+
let toolsPosition = (_config$toolsPosition = config === null || config === void 0 ? void 0 : config.toolsPosition) !== null && _config$toolsPosition !== void 0 ? _config$toolsPosition : 'inline';
|
|
18
|
+
if (shy !== 'focus') toolsPosition = 'inline';
|
|
19
|
+
return {
|
|
20
|
+
min: (_config$min = config === null || config === void 0 ? void 0 : config.min) !== null && _config$min !== void 0 ? _config$min : 10,
|
|
21
|
+
max: (_config$max = config === null || config === void 0 ? void 0 : config.max) !== null && _config$max !== void 0 ? _config$max : 200,
|
|
22
|
+
autofitOnChange: (_config$autofitOnChan = config === null || config === void 0 ? void 0 : config.autofitOnChange) !== null && _config$autofitOnChan !== void 0 ? _config$autofitOnChan : false,
|
|
23
|
+
truncate: (_config$truncate = config === null || config === void 0 ? void 0 : config.truncate) !== null && _config$truncate !== void 0 ? _config$truncate : false,
|
|
24
|
+
priceText: (_config$priceText = config === null || config === void 0 ? void 0 : config.priceText) !== null && _config$priceText !== void 0 ? _config$priceText : false,
|
|
25
|
+
selectButtonStyle: (_config$selectButtonS = config === null || config === void 0 ? void 0 : config.selectButtonStyle) !== null && _config$selectButtonS !== void 0 ? _config$selectButtonS : 'inline',
|
|
26
|
+
selectButtonLabel: (_config$selectButtonL = config === null || config === void 0 ? void 0 : config.selectButtonLabel) !== null && _config$selectButtonL !== void 0 ? _config$selectButtonL : 'Select',
|
|
27
|
+
selectButton: (_ref = (_config$selectButton = config === null || config === void 0 ? void 0 : config.selectButton) !== null && _config$selectButton !== void 0 ? _config$selectButton : config === null || config === void 0 ? void 0 : config.buyButton) !== null && _ref !== void 0 ? _ref : true,
|
|
28
|
+
shy,
|
|
29
|
+
toolsPosition,
|
|
30
|
+
selectable: (_config$selectable = config === null || config === void 0 ? void 0 : config.selectable) !== null && _config$selectable !== void 0 ? _config$selectable : false,
|
|
31
|
+
priceBar: (_config$priceBar = config === null || config === void 0 ? void 0 : config.priceBar) !== null && _config$priceBar !== void 0 ? _config$priceBar : false,
|
|
32
|
+
textInput: (_config$textInput = config === null || config === void 0 ? void 0 : config.textInput) !== null && _config$textInput !== void 0 ? _config$textInput : false,
|
|
33
|
+
initialMode: (_config$initialMode = config === null || config === void 0 ? void 0 : config.initialMode) !== null && _config$initialMode !== void 0 ? _config$initialMode : 'local',
|
|
34
|
+
groupEdit: (_config$groupEdit = config === null || config === void 0 ? void 0 : config.groupEdit) !== null && _config$groupEdit !== void 0 ? _config$groupEdit : false,
|
|
35
|
+
bulletStyle: (_config$bulletStyle = config === null || config === void 0 ? void 0 : config.bulletStyle) !== null && _config$bulletStyle !== void 0 ? _config$bulletStyle : 'square',
|
|
36
|
+
openTypeFeatures: {
|
|
37
|
+
columns: config === null || config === void 0 ? void 0 : (_config$openTypeFeatu = config.openTypeFeatures) === null || _config$openTypeFeatu === void 0 ? void 0 : _config$openTypeFeatu.columns,
|
|
38
|
+
selectionStyle: (_config$openTypeFeatu2 = config === null || config === void 0 ? void 0 : (_config$openTypeFeatu3 = config.openTypeFeatures) === null || _config$openTypeFeatu3 === void 0 ? void 0 : _config$openTypeFeatu3.selectionStyle) !== null && _config$openTypeFeatu2 !== void 0 ? _config$openTypeFeatu2 : 'bullet'
|
|
39
|
+
},
|
|
40
|
+
alignmentButtons: (_config$alignmentButt = config === null || config === void 0 ? void 0 : config.alignmentButtons) !== null && _config$alignmentButt !== void 0 ? _config$alignmentButt : false,
|
|
41
|
+
initialAlignment: (_config$initialAlignm = config === null || config === void 0 ? void 0 : config.initialAlignment) !== null && _config$initialAlignm !== void 0 ? _config$initialAlignm : 'left'
|
|
42
|
+
};
|
|
43
|
+
};
|
|
44
|
+
|
|
45
|
+
const makeConfig = config => {
|
|
46
|
+
var _config$form$checkbox, _config$form, _config$storeModal$in, _config$storeModal, _config$storeModal$pr, _config$storeModal2;
|
|
47
|
+
|
|
48
|
+
return {
|
|
49
|
+
typeTester: makeTypeTesterConfig(config === null || config === void 0 ? void 0 : config.typeTester),
|
|
50
|
+
form: {
|
|
51
|
+
checkboxStyle: (_config$form$checkbox = config === null || config === void 0 ? void 0 : (_config$form = config.form) === null || _config$form === void 0 ? void 0 : _config$form.checkboxStyle) !== null && _config$form$checkbox !== void 0 ? _config$form$checkbox : 'check'
|
|
52
|
+
},
|
|
53
|
+
storeModal: {
|
|
54
|
+
indexLayout: (_config$storeModal$in = config === null || config === void 0 ? void 0 : (_config$storeModal = config.storeModal) === null || _config$storeModal === void 0 ? void 0 : _config$storeModal.indexLayout) !== null && _config$storeModal$in !== void 0 ? _config$storeModal$in : 'styled-aa',
|
|
55
|
+
productLicensesPosition: (_config$storeModal$pr = config === null || config === void 0 ? void 0 : (_config$storeModal2 = config.storeModal) === null || _config$storeModal2 === void 0 ? void 0 : _config$storeModal2.productLicensesPosition) !== null && _config$storeModal$pr !== void 0 ? _config$storeModal$pr : 'bottom'
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
};
|
|
59
|
+
|
|
60
|
+
exports.makeConfig = makeConfig;
|
|
61
|
+
|
|
62
|
+
var _default = /*#__PURE__*/_react.default.createContext(makeConfig());
|
|
13
63
|
|
|
14
64
|
exports.default = _default;
|
|
@@ -13,7 +13,7 @@ var _reactRedux = require("react-redux");
|
|
|
13
13
|
|
|
14
14
|
var _Stylesheet = require("../Stylesheet");
|
|
15
15
|
|
|
16
|
-
var _ConfigContext =
|
|
16
|
+
var _ConfigContext = _interopRequireWildcard(require("../ConfigContext"));
|
|
17
17
|
|
|
18
18
|
var _ComponentsContext = _interopRequireDefault(require("../ComponentsContext"));
|
|
19
19
|
|
|
@@ -46,7 +46,7 @@ const FontdueProvider = _ref => {
|
|
|
46
46
|
}, /*#__PURE__*/_react.default.createElement(_reactRedux.Provider, {
|
|
47
47
|
store: _reducer.store
|
|
48
48
|
}, /*#__PURE__*/_react.default.createElement(_Stylesheet.StylesheetContainer, null), /*#__PURE__*/_react.default.createElement(_ThemeConfig.default, null), /*#__PURE__*/_react.default.createElement(_ConfigContext.default.Provider, {
|
|
49
|
-
value:
|
|
49
|
+
value: (0, _ConfigContext.makeConfig)(config)
|
|
50
50
|
}, /*#__PURE__*/_react.default.createElement(_ComponentsContext.default.Provider, {
|
|
51
51
|
value: components !== null && components !== void 0 ? components : {}
|
|
52
52
|
}, /*#__PURE__*/_react.default.createElement(_TestModeBanner.default, null), children))));
|
|
@@ -30,8 +30,6 @@ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj &&
|
|
|
30
30
|
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
31
31
|
|
|
32
32
|
const DefaultSelectButton = _ref => {
|
|
33
|
-
var _config$selectButtonL;
|
|
34
|
-
|
|
35
33
|
let {
|
|
36
34
|
productId,
|
|
37
35
|
innerProps: {
|
|
@@ -61,7 +59,7 @@ const DefaultSelectButton = _ref => {
|
|
|
61
59
|
return /*#__PURE__*/_react.default.createElement("button", _extends({}, rest, {
|
|
62
60
|
onClick: handleClick,
|
|
63
61
|
className: "select-button"
|
|
64
|
-
}),
|
|
62
|
+
}), config.selectButtonLabel);
|
|
65
63
|
};
|
|
66
64
|
|
|
67
65
|
const SelectButton = _ref2 => {
|
|
@@ -36,12 +36,14 @@ const plural = (count, singularString, pluralString) => {
|
|
|
36
36
|
};
|
|
37
37
|
|
|
38
38
|
const StoreModalIndex = _ref => {
|
|
39
|
-
var _viewer$rootCollectio, _viewer$rootCollectio2
|
|
39
|
+
var _viewer$rootCollectio, _viewer$rootCollectio2;
|
|
40
40
|
|
|
41
41
|
let {
|
|
42
42
|
prepared
|
|
43
43
|
} = _ref;
|
|
44
|
-
const
|
|
44
|
+
const {
|
|
45
|
+
storeModal: config
|
|
46
|
+
} = (0, _react.useContext)(_ConfigContext.default);
|
|
45
47
|
const data = (0, _reactRelay.usePreloadedQuery)(_StoreModalIndexQuery !== void 0 ? _StoreModalIndexQuery : (_StoreModalIndexQuery = require("../../__generated__/StoreModalIndexQuery.graphql"), _StoreModalIndexQuery.hash && _StoreModalIndexQuery.hash !== "320b414c78b179d8791e18dd840c5af6" && console.error("The definition of 'StoreModalIndexQuery' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _StoreModalIndexQuery), prepared.indexQuery);
|
|
46
48
|
const dispatch = (0, _reactRedux.useDispatch)();
|
|
47
49
|
const viewer = data.viewer;
|
|
@@ -57,7 +59,6 @@ const StoreModalIndex = _ref => {
|
|
|
57
59
|
});
|
|
58
60
|
};
|
|
59
61
|
|
|
60
|
-
const indexLayout = (config === null || config === void 0 ? void 0 : (_config$storeModal = config.storeModal) === null || _config$storeModal === void 0 ? void 0 : _config$storeModal.indexLayout) || 'styled-aa';
|
|
61
62
|
return /*#__PURE__*/_react.default.createElement(_StoreModalPageContainer.default, null, {
|
|
62
63
|
title: 'All collections',
|
|
63
64
|
body: edges.map(edge => {
|
|
@@ -67,12 +68,12 @@ const StoreModalIndex = _ref => {
|
|
|
67
68
|
key: edge.node.id,
|
|
68
69
|
onClick: handleClickProduct.bind(null, edge.node.id)
|
|
69
70
|
}, {
|
|
70
|
-
aa: indexLayout === 'styled-aa' && (edge.node.featureStyle ? /*#__PURE__*/_react.default.createElement(_react.Fragment, null, ((_edge$node$featureSty = edge.node.featureStyle.family) === null || _edge$node$featureSty === void 0 ? void 0 : _edge$node$featureSty.cssUrl) && /*#__PURE__*/_react.default.createElement(_Stylesheet.default, {
|
|
71
|
+
aa: config.indexLayout === 'styled-aa' && (edge.node.featureStyle ? /*#__PURE__*/_react.default.createElement(_react.Fragment, null, ((_edge$node$featureSty = edge.node.featureStyle.family) === null || _edge$node$featureSty === void 0 ? void 0 : _edge$node$featureSty.cssUrl) && /*#__PURE__*/_react.default.createElement(_Stylesheet.default, {
|
|
71
72
|
href: edge.node.featureStyle.family.cssUrl
|
|
72
73
|
}), /*#__PURE__*/_react.default.createElement(_FontStyle.default, {
|
|
73
74
|
fontStyle: edge.node.featureStyle
|
|
74
75
|
}, "Aa")) : null),
|
|
75
|
-
name: indexLayout === 'styled-font-names' ? edge.node.featureStyle && /*#__PURE__*/_react.default.createElement(_react.Fragment, null, ((_edge$node$featureSty2 = edge.node.featureStyle.family) === null || _edge$node$featureSty2 === void 0 ? void 0 : _edge$node$featureSty2.cssUrl) && /*#__PURE__*/_react.default.createElement(_Stylesheet.default, {
|
|
76
|
+
name: config.indexLayout === 'styled-font-names' ? edge.node.featureStyle && /*#__PURE__*/_react.default.createElement(_react.Fragment, null, ((_edge$node$featureSty2 = edge.node.featureStyle.family) === null || _edge$node$featureSty2 === void 0 ? void 0 : _edge$node$featureSty2.cssUrl) && /*#__PURE__*/_react.default.createElement(_Stylesheet.default, {
|
|
76
77
|
href: edge.node.featureStyle.family.cssUrl
|
|
77
78
|
}), /*#__PURE__*/_react.default.createElement(_FontStyle.default, {
|
|
78
79
|
fontStyle: edge.node.featureStyle
|
|
@@ -20,8 +20,6 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
20
20
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
21
21
|
|
|
22
22
|
const LicenseElement = _ref => {
|
|
23
|
-
var _config$form$checkbox, _config$form;
|
|
24
|
-
|
|
25
23
|
let {
|
|
26
24
|
onClick,
|
|
27
25
|
isSelected,
|
|
@@ -30,8 +28,9 @@ const LicenseElement = _ref => {
|
|
|
30
28
|
variables
|
|
31
29
|
}
|
|
32
30
|
} = _ref;
|
|
33
|
-
const
|
|
34
|
-
|
|
31
|
+
const {
|
|
32
|
+
form: config
|
|
33
|
+
} = (0, _react.useContext)(_ConfigContext.default);
|
|
35
34
|
return /*#__PURE__*/_react.default.createElement(_Button.default, {
|
|
36
35
|
onClick: onClick,
|
|
37
36
|
className: "store-modal__license-selection__license-button",
|
|
@@ -40,7 +39,7 @@ const LicenseElement = _ref => {
|
|
|
40
39
|
className: "store-modal__license-selection__license-button-label"
|
|
41
40
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
42
41
|
className: "store-modal__license-selection__icon-pair"
|
|
43
|
-
}, isSelected ? checkboxStyle === 'check' ? /*#__PURE__*/_react.default.createElement(_Icons.CheckboxChecked, null) : /*#__PURE__*/_react.default.createElement(_Icons.CheckboxCrossed, null) : /*#__PURE__*/_react.default.createElement(_Icons.Checkbox, null), name)), /*#__PURE__*/_react.default.createElement("div", {
|
|
42
|
+
}, isSelected ? config.checkboxStyle === 'check' ? /*#__PURE__*/_react.default.createElement(_Icons.CheckboxChecked, null) : /*#__PURE__*/_react.default.createElement(_Icons.CheckboxCrossed, null) : /*#__PURE__*/_react.default.createElement(_Icons.Checkbox, null), name)), /*#__PURE__*/_react.default.createElement("div", {
|
|
44
43
|
className: "store-modal__license-selection__variables"
|
|
45
44
|
}, variables));
|
|
46
45
|
};
|
|
@@ -11,16 +11,18 @@ var _TypeTesterContext = require("./TypeTesterContext");
|
|
|
11
11
|
|
|
12
12
|
var _TypeTesterBullet = _interopRequireDefault(require("./TypeTesterBullet"));
|
|
13
13
|
|
|
14
|
+
var _ConfigContext = _interopRequireDefault(require("../ConfigContext"));
|
|
15
|
+
|
|
14
16
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
17
|
|
|
16
18
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
17
19
|
|
|
18
20
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
19
21
|
|
|
20
|
-
const TypeTesterEditAll =
|
|
21
|
-
|
|
22
|
-
config
|
|
23
|
-
} =
|
|
22
|
+
const TypeTesterEditAll = () => {
|
|
23
|
+
const {
|
|
24
|
+
typeTester: config
|
|
25
|
+
} = (0, _react.useContext)(_ConfigContext.default);
|
|
24
26
|
const {
|
|
25
27
|
mode,
|
|
26
28
|
dispatch
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
import { TypeTesterFeatures_fontStyle } from '../../__generated__/TypeTesterFeatures_fontStyle.graphql';
|
|
2
|
-
import { TypeTesterConfig } from '.';
|
|
3
2
|
interface TypeTesterFeatures_props {
|
|
4
3
|
id: string;
|
|
5
4
|
fontStyle: TypeTesterFeatures_fontStyle;
|
|
6
5
|
features: ReadonlyArray<string>;
|
|
7
|
-
config: TypeTesterConfig;
|
|
8
6
|
}
|
|
9
7
|
declare const _default: import("react-relay").Container<TypeTesterFeatures_props>;
|
|
10
8
|
export default _default;
|
|
@@ -17,6 +17,8 @@ var _TypeTesterState = _interopRequireDefault(require("./TypeTesterState"));
|
|
|
17
17
|
|
|
18
18
|
var _Checkbox = _interopRequireDefault(require("../Checkbox"));
|
|
19
19
|
|
|
20
|
+
var _ConfigContext = _interopRequireDefault(require("../ConfigContext"));
|
|
21
|
+
|
|
20
22
|
var _TypeTesterFeatures_stylisticSetName, _TypeTesterFeatures_fontStyle;
|
|
21
23
|
|
|
22
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -87,14 +89,16 @@ const getFeatureName = (feature, stylisticSetNames) => {
|
|
|
87
89
|
_TypeTesterFeatures_stylisticSetName !== void 0 ? _TypeTesterFeatures_stylisticSetName : (_TypeTesterFeatures_stylisticSetName = require("../../__generated__/TypeTesterFeatures_stylisticSetName.graphql"), _TypeTesterFeatures_stylisticSetName.hash && _TypeTesterFeatures_stylisticSetName.hash !== "8420321d8ddf9b3846450d609586db21" && console.error("The definition of 'TypeTesterFeatures_stylisticSetName' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _TypeTesterFeatures_stylisticSetName);
|
|
88
90
|
|
|
89
91
|
const TypeTesterFeatures = _ref2 => {
|
|
90
|
-
var _config$openTypeFeatu, _config$openTypeFeatu2, _config$openTypeFeatu3, _config$openTypeFeatu4
|
|
92
|
+
var _config$openTypeFeatu, _config$openTypeFeatu2, _config$openTypeFeatu3, _config$openTypeFeatu4;
|
|
91
93
|
|
|
92
94
|
let {
|
|
93
95
|
id,
|
|
94
96
|
fontStyle,
|
|
95
|
-
features: showFeatures
|
|
96
|
-
config
|
|
97
|
+
features: showFeatures
|
|
97
98
|
} = _ref2;
|
|
99
|
+
const {
|
|
100
|
+
typeTester: config
|
|
101
|
+
} = (0, _react.useContext)(_ConfigContext.default);
|
|
98
102
|
const {
|
|
99
103
|
features,
|
|
100
104
|
toggleFeature,
|
|
@@ -102,7 +106,7 @@ const TypeTesterFeatures = _ref2 => {
|
|
|
102
106
|
} = (0, _TypeTesterState.default)({
|
|
103
107
|
id
|
|
104
108
|
});
|
|
105
|
-
const selectionStyle =
|
|
109
|
+
const selectionStyle = config.openTypeFeatures.selectionStyle;
|
|
106
110
|
|
|
107
111
|
const renderFeature = feature => {
|
|
108
112
|
var _fontStyle$fontFeatur;
|
|
@@ -128,7 +132,7 @@ const TypeTesterFeatures = _ref2 => {
|
|
|
128
132
|
|
|
129
133
|
let featuresColumns;
|
|
130
134
|
|
|
131
|
-
if ((_config$
|
|
135
|
+
if ((_config$openTypeFeatu = config.openTypeFeatures) !== null && _config$openTypeFeatu !== void 0 && (_config$openTypeFeatu2 = _config$openTypeFeatu.columns) !== null && _config$openTypeFeatu2 !== void 0 && _config$openTypeFeatu2.length) {
|
|
132
136
|
featuresColumns = /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, config.openTypeFeatures.columns.map((columnConfig, i) => /*#__PURE__*/_react.default.createElement("div", {
|
|
133
137
|
key: i,
|
|
134
138
|
"data-range": columnConfig.range,
|
|
@@ -157,7 +161,8 @@ const TypeTesterFeatures = _ref2 => {
|
|
|
157
161
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
158
162
|
ref: featuresContentRef,
|
|
159
163
|
className: "type-tester__features",
|
|
160
|
-
"data-
|
|
164
|
+
"data-selection-style": selectionStyle,
|
|
165
|
+
"data-columns": (_config$openTypeFeatu3 = config.openTypeFeatures) !== null && _config$openTypeFeatu3 !== void 0 && (_config$openTypeFeatu4 = _config$openTypeFeatu3.columns) !== null && _config$openTypeFeatu4 !== void 0 && _config$openTypeFeatu4.length ? 'set' : 'auto'
|
|
161
166
|
}, featuresColumns));
|
|
162
167
|
};
|
|
163
168
|
|
|
@@ -26,7 +26,7 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
26
26
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
27
27
|
|
|
28
28
|
const TypeTesterFloatingToolbar = _ref => {
|
|
29
|
-
var _testersData$find
|
|
29
|
+
var _testersData$find;
|
|
30
30
|
|
|
31
31
|
let {
|
|
32
32
|
testers: testersData,
|
|
@@ -77,13 +77,11 @@ const TypeTesterFloatingToolbar = _ref => {
|
|
|
77
77
|
"data-open": activeId && open
|
|
78
78
|
}, activeId && /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, /*#__PURE__*/_react.default.createElement(_TypeTesterToolbar.default, {
|
|
79
79
|
id: activeId,
|
|
80
|
-
features: features
|
|
81
|
-
config: (_config$typeTester = config.typeTester) !== null && _config$typeTester !== void 0 ? _config$typeTester : {}
|
|
80
|
+
features: features
|
|
82
81
|
}), features && fontStyle && /*#__PURE__*/_react.default.createElement(_TypeTesterFeatures.default, {
|
|
83
82
|
id: activeId,
|
|
84
83
|
features: features,
|
|
85
|
-
fontStyle: fontStyle
|
|
86
|
-
config: (_config$typeTester2 = config.typeTester) !== null && _config$typeTester2 !== void 0 ? _config$typeTester2 : {}
|
|
84
|
+
fontStyle: fontStyle
|
|
87
85
|
})));
|
|
88
86
|
};
|
|
89
87
|
|
|
@@ -37,14 +37,14 @@ const TypeTesterStandalone = _ref => {
|
|
|
37
37
|
} = _ref;
|
|
38
38
|
const environment = (0, _reactRelay.useRelayEnvironment)();
|
|
39
39
|
return /*#__PURE__*/_react.default.createElement(_reactRelay.QueryRenderer, {
|
|
40
|
-
query: _TypeTesterStandalone_StyleQuery !== void 0 ? _TypeTesterStandalone_StyleQuery : (_TypeTesterStandalone_StyleQuery = require("../../__generated__/TypeTesterStandalone_StyleQuery.graphql"), _TypeTesterStandalone_StyleQuery.hash && _TypeTesterStandalone_StyleQuery.hash !== "
|
|
40
|
+
query: _TypeTesterStandalone_StyleQuery !== void 0 ? _TypeTesterStandalone_StyleQuery : (_TypeTesterStandalone_StyleQuery = require("../../__generated__/TypeTesterStandalone_StyleQuery.graphql"), _TypeTesterStandalone_StyleQuery.hash && _TypeTesterStandalone_StyleQuery.hash !== "6b7470fc7c096c1adc484c7b3d32b126" && console.error("The definition of 'TypeTesterStandalone_StyleQuery' appears to have changed. Run `relay-compiler` to update the generated files to receive the expected data."), _TypeTesterStandalone_StyleQuery),
|
|
41
41
|
variables: {
|
|
42
42
|
familyName,
|
|
43
43
|
styleName
|
|
44
44
|
},
|
|
45
45
|
environment: environment,
|
|
46
46
|
render: _ref2 => {
|
|
47
|
-
var _props$viewer$fontSty, _props$viewer, _props$viewer$fontSty2, _features$split;
|
|
47
|
+
var _props$viewer$fontSty, _props$viewer, _props$viewer$fontSty2, _features$split, _props$viewer$fontSty3, _props$viewer2, _props$viewer2$fontSt, _props$viewer2$fontSt2, _props$viewer2$fontSt3, _props$viewer3, _props$viewer3$fontSt, _props$viewer3$fontSt2;
|
|
48
48
|
|
|
49
49
|
let {
|
|
50
50
|
props
|
|
@@ -66,7 +66,7 @@ const TypeTesterStandalone = _ref => {
|
|
|
66
66
|
fontStyleId: (_props$viewer$fontSty = (_props$viewer = props.viewer) === null || _props$viewer === void 0 ? void 0 : (_props$viewer$fontSty2 = _props$viewer.fontStyle) === null || _props$viewer$fontSty2 === void 0 ? void 0 : _props$viewer$fontSty2.id) !== null && _props$viewer$fontSty !== void 0 ? _props$viewer$fontSty : null,
|
|
67
67
|
features: (_features$split = features === null || features === void 0 ? void 0 : features.split(',')) !== null && _features$split !== void 0 ? _features$split : [],
|
|
68
68
|
direction: direction === 'rtl' ? 'rtl' : 'ltr',
|
|
69
|
-
productId:
|
|
69
|
+
productId: (_props$viewer$fontSty3 = (_props$viewer2 = props.viewer) === null || _props$viewer2 === void 0 ? void 0 : (_props$viewer2$fontSt = _props$viewer2.fontStyle) === null || _props$viewer2$fontSt === void 0 ? void 0 : (_props$viewer2$fontSt2 = _props$viewer2$fontSt.family) === null || _props$viewer2$fontSt2 === void 0 ? void 0 : (_props$viewer2$fontSt3 = _props$viewer2$fontSt2.parent) === null || _props$viewer2$fontSt3 === void 0 ? void 0 : _props$viewer2$fontSt3.id) !== null && _props$viewer$fontSty3 !== void 0 ? _props$viewer$fontSty3 : (_props$viewer3 = props.viewer) === null || _props$viewer3 === void 0 ? void 0 : (_props$viewer3$fontSt = _props$viewer3.fontStyle) === null || _props$viewer3$fontSt === void 0 ? void 0 : (_props$viewer3$fontSt2 = _props$viewer3$fontSt.family) === null || _props$viewer3$fontSt2 === void 0 ? void 0 : _props$viewer3$fontSt2.id,
|
|
70
70
|
config: {
|
|
71
71
|
groupEdit: false,
|
|
72
72
|
buyButton: false
|
|
@@ -14,8 +14,6 @@ var _ConfigContext = _interopRequireDefault(require("../ConfigContext"));
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
|
|
16
16
|
const useTypeTesterState = _ref => {
|
|
17
|
-
var _config$typeTester$to, _config$typeTester;
|
|
18
|
-
|
|
19
17
|
let {
|
|
20
18
|
id
|
|
21
19
|
} = _ref;
|
|
@@ -25,7 +23,7 @@ const useTypeTesterState = _ref => {
|
|
|
25
23
|
globalFeaturesOpen,
|
|
26
24
|
dispatch
|
|
27
25
|
} = (0, _react.useContext)(_TypeTesterContext.TypeTesterContext);
|
|
28
|
-
const toolsPosition =
|
|
26
|
+
const toolsPosition = config.typeTester.toolsPosition;
|
|
29
27
|
const {
|
|
30
28
|
content,
|
|
31
29
|
contentEdited,
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { TypeTesterConfig } from '.';
|
|
3
2
|
interface TypeTesterToolbar_props {
|
|
4
3
|
id: string;
|
|
5
4
|
features: readonly string[] | null | undefined;
|
|
6
|
-
config: TypeTesterConfig;
|
|
7
5
|
}
|
|
8
6
|
declare const TypeTesterToolbar: React.FC<TypeTesterToolbar_props>;
|
|
9
7
|
export default TypeTesterToolbar;
|
|
@@ -5,7 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
7
|
|
|
8
|
-
var _react =
|
|
8
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
9
9
|
|
|
10
10
|
var _TypeTesterFeaturesButton = _interopRequireDefault(require("./TypeTesterFeaturesButton"));
|
|
11
11
|
|
|
@@ -19,18 +19,22 @@ var _TypeTesterState = _interopRequireDefault(require("./TypeTesterState"));
|
|
|
19
19
|
|
|
20
20
|
var _TypeTesterAlignButtons = _interopRequireDefault(require("./TypeTesterAlignButtons"));
|
|
21
21
|
|
|
22
|
+
var _ConfigContext = _interopRequireDefault(require("../ConfigContext"));
|
|
23
|
+
|
|
22
24
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
23
25
|
|
|
24
|
-
function
|
|
26
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
25
27
|
|
|
26
|
-
|
|
27
|
-
var _config$min, _config$max, _config$min2, _config$max2;
|
|
28
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
28
29
|
|
|
30
|
+
const TypeTesterToolbar = _ref => {
|
|
29
31
|
let {
|
|
30
32
|
id,
|
|
31
|
-
features
|
|
32
|
-
config
|
|
33
|
+
features
|
|
33
34
|
} = _ref;
|
|
35
|
+
const {
|
|
36
|
+
typeTester: config
|
|
37
|
+
} = (0, _react.useContext)(_ConfigContext.default);
|
|
34
38
|
const props = (0, _TypeTesterState.default)({
|
|
35
39
|
id
|
|
36
40
|
});
|
|
@@ -40,18 +44,16 @@ const TypeTesterToolbar = _ref => {
|
|
|
40
44
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
41
45
|
className: "type-tester__slider"
|
|
42
46
|
}, config.textInput && /*#__PURE__*/_react.default.createElement(_TypeTesterInput.default, {
|
|
43
|
-
min:
|
|
44
|
-
max:
|
|
47
|
+
min: config.min,
|
|
48
|
+
max: config.max,
|
|
45
49
|
value: props.size,
|
|
46
50
|
onChange: props.setSize
|
|
47
51
|
}), /*#__PURE__*/_react.default.createElement(_TypeTesterSlider.default, {
|
|
48
|
-
min:
|
|
49
|
-
max:
|
|
52
|
+
min: config.min,
|
|
53
|
+
max: config.max,
|
|
50
54
|
value: props.size,
|
|
51
55
|
onChange: props.setSize
|
|
52
|
-
})), Boolean(features === null || features === void 0 ? void 0 : features.length) && /*#__PURE__*/_react.default.createElement(_TypeTesterFeaturesButton.default, props), config.alignmentButtons && /*#__PURE__*/_react.default.createElement(_TypeTesterAlignButtons.default, props), config.groupEdit && /*#__PURE__*/_react.default.createElement(_TypeTesterEditAll.default,
|
|
53
|
-
config: config
|
|
54
|
-
})));
|
|
56
|
+
})), Boolean(features === null || features === void 0 ? void 0 : features.length) && /*#__PURE__*/_react.default.createElement(_TypeTesterFeaturesButton.default, props), config.alignmentButtons && /*#__PURE__*/_react.default.createElement(_TypeTesterAlignButtons.default, props), config.groupEdit && /*#__PURE__*/_react.default.createElement(_TypeTesterEditAll.default, props));
|
|
55
57
|
};
|
|
56
58
|
|
|
57
59
|
var _default = TypeTesterToolbar;
|
|
@@ -5,6 +5,7 @@ export interface TypeTesterConfig {
|
|
|
5
5
|
max?: number;
|
|
6
6
|
selectable?: boolean;
|
|
7
7
|
priceBar?: boolean;
|
|
8
|
+
selectButton?: boolean;
|
|
8
9
|
buyButton?: boolean;
|
|
9
10
|
textInput?: boolean;
|
|
10
11
|
initialMode?: 'group' | 'local';
|
|
@@ -32,7 +33,7 @@ export interface TypeTesterConfig {
|
|
|
32
33
|
}
|
|
33
34
|
export interface TypeTesterBaseProps {
|
|
34
35
|
id: string;
|
|
35
|
-
productId
|
|
36
|
+
productId?: string;
|
|
36
37
|
direction: 'ltr' | 'rtl';
|
|
37
38
|
onSelectFontStyleId: (value: string) => void;
|
|
38
39
|
features?: readonly string[] | null;
|