@demos-europe/demosplan-ui 0.3.21 → 0.3.24
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/.idea/shelf/Uncommitted_changes_before_Checkout_at_26_07_2024_16_29_[Changes]/shelved.patch +30800 -0
- package/.idea/shelf/Uncommitted_changes_before_Checkout_at_26_07_2024_16_29__Changes_.xml +4 -0
- package/.idea/workspace.xml +129 -46
- package/.yarn/install-state.gz +0 -0
- package/CHANGELOG.md +21 -0
- package/dist/demosplan-ui.umd.js +1 -1
- package/package.json +19 -6
- package/scripts/buildTokens.js +118 -0
- package/scripts/utils/transformTokens.js +249 -0
- package/src/components/DpDataTable/DpDataTable.vue +6 -2
- package/src/components/DpDataTable/DpTableHeader.vue +6 -2
- package/src/components/DpEditor/libs/editorCustomLink.js +3 -0
- package/src/lib/DpApi.js +2 -2
- package/tailwind.config.js +20 -50
- package/tokens/dist/js/boxShadow.js +10 -10
- package/tokens/dist/js/breakpoints.js +1 -1
- package/tokens/dist/js/color.brand.js +1 -1
- package/tokens/dist/js/color.data.js +1 -1
- package/tokens/dist/js/color.palette.js +1 -1
- package/tokens/dist/js/color.ui-tailwind.js +1 -1
- package/tokens/dist/js/color.ui.js +68 -68
- package/tokens/dist/js/fontSize.js +86 -98
- package/tokens/dist/js/rounded.js +1 -1
- package/tokens/dist/js/space.js +1 -1
- package/tokens/dist/js/zIndex.js +18 -18
- package/tokens/dist/scss/_boxShadow.scss +1 -1
- package/tokens/dist/scss/_breakpoints.scss +1 -1
- package/tokens/dist/scss/_color.brand.scss +1 -1
- package/tokens/dist/scss/_color.data.scss +1 -1
- package/tokens/dist/scss/_color.palette.scss +1 -1
- package/tokens/dist/scss/_color.ui.scss +1 -1
- package/tokens/dist/scss/_fontSize.scss +13 -7
- package/tokens/dist/scss/_rounded.scss +1 -1
- package/tokens/dist/scss/_space.scss +1 -1
- package/tokens/dist/scss/_zIndex.scss +1 -1
- package/tokens/dist/tailwind/backgroundColor.js +22 -22
- package/tokens/dist/tailwind/borderColor.js +7 -7
- package/tokens/dist/tailwind/boxShadow.js +6 -0
- package/tokens/dist/tailwind/breakpoints.js +6 -0
- package/tokens/dist/tailwind/color.js +37 -3
- package/tokens/dist/tailwind/fontSize.js +16 -0
- package/tokens/dist/tailwind/rounded.js +8 -0
- package/tokens/dist/tailwind/space.js +20 -0
- package/tokens/dist/tailwind/textColor.js +35 -35
- package/tokens/dist/tailwind/zIndex.js +10 -0
- package/tokens/src/boxShadow.json +5 -5
- package/tokens/src/color/color.ui.json +397 -0
- package/tokens/src/fontSize.json +47 -23
- package/tokens/src/zIndex.json +1 -1
- package/yarn-error.log +13974 -0
- package/.idea/shelf/Uncommitted_changes_before_Update_at_17_07_2024_15_21_[Changes]/shelved.patch +0 -36
- package/.idea/shelf/Uncommitted_changes_before_Update_at_17_07_2024_15_21__Changes_.xml +0 -4
- package/buildTokens.js +0 -240
- package/tokens/src/color/color.ui-tailwind.json +0 -401
package/.idea/shelf/Uncommitted_changes_before_Update_at_17_07_2024_15_21_[Changes]/shelved.patch
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
Index: package.json
|
|
2
|
-
IDEA additional info:
|
|
3
|
-
Subsystem: com.intellij.openapi.diff.impl.patch.BaseRevisionTextPatchEP
|
|
4
|
-
<+>{\n \"name\": \"@demos-europe/demosplan-ui\",\n \"version\": \"0.3.19\",\n \"license\": \"MIT\",\n \"private\": false,\n \"description\": \"Vue components, Vue directives, Design Token and Scss files to build interfaces for demosPlan.\",\n \"main\": \"./dist/demosplan-ui.umd.js\",\n \"dependencies\": {\n \"@braintree/sanitize-url\": \"^7.0.0\",\n \"@floating-ui/dom\": \"^1.4.5\",\n \"@tiptap/core\": \"^2.0.3\",\n \"@tiptap/extension-bold\": \"^2.0.3\",\n \"@tiptap/extension-bullet-list\": \"^2.0.3\",\n \"@tiptap/extension-document\": \"^2.0.3\",\n \"@tiptap/extension-hard-break\": \"^2.0.3\",\n \"@tiptap/extension-heading\": \"^2.0.3\",\n \"@tiptap/extension-history\": \"^2.0.3\",\n \"@tiptap/extension-italic\": \"^2.0.3\",\n \"@tiptap/extension-link\": \"^2.0.3\",\n \"@tiptap/extension-list-item\": \"^2.0.3\",\n \"@tiptap/extension-mention\": \"^2.0.3\",\n \"@tiptap/extension-ordered-list\": \"^2.0.3\",\n \"@tiptap/extension-paragraph\": \"^2.0.3\",\n \"@tiptap/extension-strike\": \"^2.0.3\",\n \"@tiptap/extension-table\": \"^2.0.3\",\n \"@tiptap/extension-table-cell\": \"^2.0.3\",\n \"@tiptap/extension-table-header\": \"^2.0.3\",\n \"@tiptap/extension-table-row\": \"^2.0.3\",\n \"@tiptap/extension-text\": \"^2.0.3\",\n \"@tiptap/extension-underline\": \"^2.0.3\",\n \"@tiptap/pm\": \"^2.0.3\",\n \"@tiptap/suggestion\": \"^2.0.3\",\n \"@tiptap/vue-2\": \"^2.0.3\",\n \"@uppy/core\": \"^3.0.1\",\n \"@uppy/drag-drop\": \"^3.0.0\",\n \"@uppy/progress-bar\": \"^3.0.0\",\n \"@uppy/tus\": \"^3.0.1\",\n \"a11y-datepicker\": \" ^0.9.0\",\n \"dayjs\": \"^1.11.5\",\n \"dompurify\": \"^3.0.0\",\n \"fscreen\": \"^1.2.0\",\n \"ismobilejs\": \"^1.1.1\",\n \"lscache\": \"^1.3.2\",\n \"plyr\": \"^3.7.2\",\n \"qs\": \"^6.11.0\",\n \"tippy.js\": \"^6.3.7\",\n \"uuid\": \"^9.0.0\",\n \"v-tooltip\": \"2.1.3\",\n \"vue-click-outside\": \"^1.1.0\",\n \"vue-multiselect\": \"^2.1.6\",\n \"vue-omnibox\": \"^0.3.7\",\n \"vue-sliding-pagination\": \"^1.3.2\",\n \"vuedraggable\": \"^2.24.3\",\n \"vuex\": \"^3.6.2\"\n },\n \"devDependencies\": {\n \"@babel/core\": \"^7.21.4\",\n \"@babel/preset-env\": \"^7.21.4\",\n \"@babel/preset-react\": \"^7.23.3\",\n \"@babel/preset-typescript\": \"^7.21.4\",\n \"@jest/globals\": \"^29.5.0\",\n \"@jest/transform\": \"^29.5.0\",\n \"@storybook/addon-actions\": \"7.6.17\",\n \"@storybook/addon-docs\": \"7.6.17\",\n \"@storybook/addon-essentials\": \"7.6.17\",\n \"@storybook/addon-links\": \"7.6.17\",\n \"@storybook/addon-styling-webpack\": \"^0.0.6\",\n \"@storybook/vue\": \"7.6.17\",\n \"@storybook/vue-webpack5\": \"7.6.17\",\n \"@types/jest\": \"^29.5.1\",\n \"@types/qs\": \"^6.9.7\",\n \"@typescript-eslint/eslint-plugin\": \"^5.4.0\",\n \"@typescript-eslint/parser\": \"^5.4.0\",\n \"@vue/cli-plugin-typescript\": \"~5.0.0\",\n \"@vue/eslint-config-typescript\": \"^12.0.0\",\n \"@vue/test-utils\": \"^1.3.5\",\n \"@vue/vue2-jest\": \"^29.2.4\",\n \"@webpack-cli/generators\": \"^3.0.0\",\n \"autoprefixer\": \"^10.4.14\",\n \"babel-core\": \"^7.0.0-bridge.0\",\n \"babel-jest\": \"^29.5.0\",\n \"babel-loader\": \"^9.1.2\",\n \"babel-plugin-syntax-jsx\": \"^6.18.0\",\n \"babel-plugin-transform-vue-jsx\": \"^3.7.0\",\n \"css-loader\": \"^7.0.0\",\n \"glob\": \"^10.3.1\",\n \"jest\": \"^29.5.0\",\n \"jest-environment-jsdom\": \"^29.3.1\",\n \"jest-junit\": \"^16.0.0\",\n \"jest-transform-stub\": \"^2.0.0\",\n \"js-beautify\": \"^1.14.7\",\n \"mini-css-extract-plugin\": \"^2.7.0\",\n \"path\": \"^0.12.7\",\n \"postcss\": \"^8.4.26\",\n \"postcss-loader\": \"^8.0.0\",\n \"react\": \"^18.2.0\",\n \"react-dom\": \"^18.2.0\",\n \"storybook\": \"7.6.17\",\n \"storybook-addon-vue-slots\": \"^0.9.21\",\n \"string-width\": \"7.1.0\",\n \"style-dictionary\": \"^3.9.2\",\n \"style-loader\": \"^4.0.0\",\n \"tailwindcss\": \"^3.2.1\",\n \"ts-jest\": \"^29.1.0\",\n \"ts-loader\": \"^9.4.4\",\n \"typescript\": \"~5.4.2\",\n \"vue-jest\": \"^3.0.7\",\n \"vue-loader\": \"^15\",\n \"vue-template-compiler\": \"^2.7.15\",\n \"webpack\": \"^5.75.0\",\n \"webpack-bundle-analyzer\": \"^4.7.0\",\n \"webpack-cli\": \"^5.0.0\"\n },\n \"engines\": {\n \"node\": \">= 18.13.0\"\n },\n \"peerDependencies\": {\n \"prosemirror-history\": \"^1.3.0\",\n \"prosemirror-model\": \"^1.18.1\",\n \"prosemirror-schema-basic\": \"^1.2.0\",\n \"prosemirror-schema-list\": \"^1.2.2\",\n \"prosemirror-state\": \"^1.4.1\",\n \"prosemirror-tables\": \"^1.3.0\",\n \"prosemirror-utils\": \"^1.2.0\",\n \"prosemirror-view\": \"^1.28.2\",\n \"vue\": \"^2.7.15\"\n },\n \"peerDependenciesMeta\": {\n \"prosemirror-history\": {\n \"optional\": true\n },\n \"prosemirror-model\": {\n \"optional\": true\n },\n \"prosemirror-schema-basic\": {\n \"optional\": true\n },\n \"prosemirror-schema-list\": {\n \"optional\": true\n },\n \"prosemirror-state\": {\n \"optional\": true\n },\n \"prosemirror-tables\": {\n \"optional\": true\n },\n \"prosemirror-utils\": {\n \"optional\": true\n },\n \"prosemirror-view\": {\n \"optional\": true\n }\n },\n \"scripts\": {\n \"build:storybook\": \"storybook build\",\n \"build:tokens\": \"node buildTokens.js\",\n \"prepack\": \"yarn build && yarn build:tokens\",\n \"storybook\": \"storybook dev -p 6006\",\n \"build\": \"yarn test && yarn build:prod\",\n \"build:dev\": \"webpack --mode=development\",\n \"build:prod\": \"webpack --mode=production --define-process-env-node-env=production\",\n \"test\": \"jest\",\n \"watch\": \"webpack --watch\"\n }\n}\n
|
|
5
|
-
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
|
|
6
|
-
<+>UTF-8
|
|
7
|
-
===================================================================
|
|
8
|
-
diff --git a/package.json b/package.json
|
|
9
|
-
--- a/package.json (revision 5c74b3474bb044112bc8eb7b0c99ecedada54235)
|
|
10
|
-
+++ b/package.json (date 1721222454849)
|
|
11
|
-
@@ -1,6 +1,6 @@
|
|
12
|
-
{
|
|
13
|
-
"name": "@demos-europe/demosplan-ui",
|
|
14
|
-
- "version": "0.3.19",
|
|
15
|
-
+ "version": "0.3.18",
|
|
16
|
-
"license": "MIT",
|
|
17
|
-
"private": false,
|
|
18
|
-
"description": "Vue components, Vue directives, Design Token and Scss files to build interfaces for demosPlan.",
|
|
19
|
-
@@ -44,7 +44,7 @@
|
|
20
|
-
"plyr": "^3.7.2",
|
|
21
|
-
"qs": "^6.11.0",
|
|
22
|
-
"tippy.js": "^6.3.7",
|
|
23
|
-
- "uuid": "^9.0.0",
|
|
24
|
-
+ "uuid": "^10.0.0",
|
|
25
|
-
"v-tooltip": "2.1.3",
|
|
26
|
-
"vue-click-outside": "^1.1.0",
|
|
27
|
-
"vue-multiselect": "^2.1.6",
|
|
28
|
-
@@ -103,7 +103,7 @@
|
|
29
|
-
"tailwindcss": "^3.2.1",
|
|
30
|
-
"ts-jest": "^29.1.0",
|
|
31
|
-
"ts-loader": "^9.4.4",
|
|
32
|
-
- "typescript": "~5.4.2",
|
|
33
|
-
+ "typescript": "~5.5.3",
|
|
34
|
-
"vue-jest": "^3.0.7",
|
|
35
|
-
"vue-loader": "^15",
|
|
36
|
-
"vue-template-compiler": "^2.7.15",
|
|
@@ -1,4 +0,0 @@
|
|
|
1
|
-
<changelist name="Uncommitted_changes_before_Update_at_17_07_2024_15_21_[Changes]" date="1721222513247" recycled="true" deleted="true">
|
|
2
|
-
<option name="PATH" value="$PROJECT_DIR$/.idea/shelf/Uncommitted_changes_before_Update_at_17_07_2024_15_21_[Changes]/shelved.patch" />
|
|
3
|
-
<option name="DESCRIPTION" value="Uncommitted changes before Update at 17 07 2024 15:21 [Changes]" />
|
|
4
|
-
</changelist>
|
package/buildTokens.js
DELETED
|
@@ -1,240 +0,0 @@
|
|
|
1
|
-
const glob = require('glob')
|
|
2
|
-
const StyleDictionary = require('style-dictionary')
|
|
3
|
-
|
|
4
|
-
const {
|
|
5
|
-
createPropertyFormatter,
|
|
6
|
-
fileHeader,
|
|
7
|
-
sortByReference
|
|
8
|
-
} = StyleDictionary.formatHelpers
|
|
9
|
-
|
|
10
|
-
const prefix = 'dp-'
|
|
11
|
-
|
|
12
|
-
const tokensPath = 'tokens/src/**/*.json'
|
|
13
|
-
|
|
14
|
-
const files = glob
|
|
15
|
-
.sync(tokensPath)
|
|
16
|
-
.map(filePath => filePath
|
|
17
|
-
.replace('tokens/src/', '')
|
|
18
|
-
.replace('color/', '')
|
|
19
|
-
.replace('.json', ''))
|
|
20
|
-
.filter(filePath => !filePath.startsWith('_')) // Do not render tokens only used internally
|
|
21
|
-
|
|
22
|
-
// Resolve token values with fallback, for css variables nesting
|
|
23
|
-
function resolveValue(token, dictionary) {
|
|
24
|
-
let value = token.value
|
|
25
|
-
const seen = new Set()
|
|
26
|
-
|
|
27
|
-
while (dictionary.usesReference(value)) {
|
|
28
|
-
seen.add(value)
|
|
29
|
-
value = dictionary.getReferences(value)[0].value
|
|
30
|
-
if (seen.has(value)) break
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return value
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
// Adds prefix to variables. Keeps uppercase path parts, which is needed later.
|
|
37
|
-
StyleDictionary.registerTransform({
|
|
38
|
-
name: 'name/scss',
|
|
39
|
-
type: 'name',
|
|
40
|
-
transformer: (token) => prefix + token.path.join('-')
|
|
41
|
-
})
|
|
42
|
-
|
|
43
|
-
// Adds prefix transform to default scss transform group
|
|
44
|
-
StyleDictionary.registerTransformGroup({
|
|
45
|
-
name: 'custom/scss',
|
|
46
|
-
transforms: StyleDictionary.transformGroup.scss.concat(['name/scss'])
|
|
47
|
-
})
|
|
48
|
-
|
|
49
|
-
// Adds prefix to variables. Keeps uppercase path parts, which is needed later.
|
|
50
|
-
StyleDictionary.registerTransform({
|
|
51
|
-
name: 'name/web',
|
|
52
|
-
type: 'name',
|
|
53
|
-
transformer: (token) => token.path.join('-')
|
|
54
|
-
})
|
|
55
|
-
|
|
56
|
-
// Adds prefix transform to default scss transform group
|
|
57
|
-
StyleDictionary.registerTransformGroup({
|
|
58
|
-
name: 'custom/web',
|
|
59
|
-
transforms: StyleDictionary.transformGroup.web.concat(['name/web'])
|
|
60
|
-
})
|
|
61
|
-
|
|
62
|
-
/**
|
|
63
|
-
* In the json tokens sources, some nesting is used for better structuring token groups.
|
|
64
|
-
* This must be resolved when transforming them into target formats.
|
|
65
|
-
* @param tokenName
|
|
66
|
-
* @param tokenPath
|
|
67
|
-
* @param targetFormat
|
|
68
|
-
* @return {*}
|
|
69
|
-
*/
|
|
70
|
-
const transformTokenName = (tokenName, tokenPath, targetFormat) => {
|
|
71
|
-
// The domain part within color tokens should not be part of the variable name.
|
|
72
|
-
if (tokenPath[0] === 'color') {
|
|
73
|
-
tokenName = tokenName.replace(/-(brand|data|palette|ui-tailwind|ui)/g, '')
|
|
74
|
-
|
|
75
|
-
if (tokenPath[1] === 'ui-tailwind' && tokenPath[2] !== 'color') {
|
|
76
|
-
tokenName = tokenName.replace(/color-/g, '')
|
|
77
|
-
} else if (tokenPath[1] === 'ui-tailwind' && tokenPath[2] === 'color') {
|
|
78
|
-
tokenName = tokenName.replace(/color-color-/g, 'color-')
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
// The domain part within font-size tokens should not be part of the variable name.
|
|
83
|
-
if (tokenPath[0] === 'font-size') {
|
|
84
|
-
tokenName = tokenName.replace(/-(scale|brand|heading|ui)/g, '')
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
// The key "z-index" should be shortened in the variable name to match Tailwind syntax
|
|
88
|
-
if (tokenPath[0] === 'z-index') {
|
|
89
|
-
tokenName = tokenName.replace(/z-index-/g, 'z-')
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
// "DEFAULT" is a Tailwind convention that should not be part of the Scss name
|
|
93
|
-
tokenName = tokenName.replace(/-DEFAULT/g, '')
|
|
94
|
-
|
|
95
|
-
if (targetFormat === 'scss') {
|
|
96
|
-
// Scss does not like variable names with dots in them, but Tailwind does, apparently.
|
|
97
|
-
if (tokenPath[0] === 'space') {
|
|
98
|
-
tokenName = tokenName.replace(/\./g, '_')
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
if (targetFormat === 'tailwind') {
|
|
103
|
-
if (tokenPath[0] === 'color' || tokenPath[1] === 'ui-tailwind') {
|
|
104
|
-
tokenName = tokenName.replace(/color-/g, '')
|
|
105
|
-
}
|
|
106
|
-
if (tokenPath[0] === 'color' && tokenPath[1] === 'ui-tailwind') {
|
|
107
|
-
tokenName = tokenName.replace(/(textColor|backgroundColor|borderColor)-/g, '')
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
return tokenName
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
const corePlugins = ['color', 'color.palette', 'color.brand', 'color.data', 'textColor', 'backgroundColor', 'borderColor']
|
|
115
|
-
|
|
116
|
-
/**
|
|
117
|
-
* Custom format that generates javascript modules ready to be used as Tailwind config files.
|
|
118
|
-
* The values use a nested set of css variables to enable theming on multiple levels.
|
|
119
|
-
*/
|
|
120
|
-
StyleDictionary.registerFormat({
|
|
121
|
-
name: 'tailwind/variables',
|
|
122
|
-
formatter({ dictionary, file }) {
|
|
123
|
-
const groupedTokens = {}
|
|
124
|
-
corePlugins.forEach(plugin => {
|
|
125
|
-
groupedTokens[plugin] = {}
|
|
126
|
-
})
|
|
127
|
-
|
|
128
|
-
dictionary.allTokens.forEach(token => {
|
|
129
|
-
const tokenName = transformTokenName(token.name, token.path, 'tailwind')
|
|
130
|
-
const varName = `--${prefix}${transformTokenName(token.name, token.path).replace(/\./g, '-')}`
|
|
131
|
-
let fallback = resolveValue(token, dictionary)
|
|
132
|
-
|
|
133
|
-
let current = token
|
|
134
|
-
let cssVar = `var(${varName}`
|
|
135
|
-
while (current.original && current.original.value.startsWith('{')) {
|
|
136
|
-
const ref = dictionary.getReferences(current.original.value)[0]
|
|
137
|
-
let refName = transformTokenName(ref.name, ref.path)
|
|
138
|
-
refName = `--${prefix}${refName.replace(/\./g, '-')}`
|
|
139
|
-
cssVar += `, var(${refName}`
|
|
140
|
-
|
|
141
|
-
current = ref
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
cssVar += `, ${fallback})`.repeat(cssVar.match(/var\(/g).length)
|
|
145
|
-
|
|
146
|
-
let regex = /#([0-9a-fA-F]{6})\), #([0-9a-fA-F]{6})/
|
|
147
|
-
let replaced = cssVar.replace(regex, '#$1)')
|
|
148
|
-
|
|
149
|
-
// Sort token definition into respective group
|
|
150
|
-
corePlugins.forEach(plugin => {
|
|
151
|
-
const isCorePluginDefinition = token.path[2] === plugin
|
|
152
|
-
const isColorDefinition = token.path[1] === plugin.replace('color.', '') && token.path[0] === 'color'
|
|
153
|
-
if (isCorePluginDefinition || isColorDefinition) {
|
|
154
|
-
groupedTokens[plugin][tokenName.replace(/\./g, '-')] = replaced + ';'
|
|
155
|
-
}
|
|
156
|
-
})
|
|
157
|
-
})
|
|
158
|
-
|
|
159
|
-
return `module.exports = ${JSON.stringify(groupedTokens[file.destination.replace('.js', '')], null, 2)};`
|
|
160
|
-
}
|
|
161
|
-
})
|
|
162
|
-
|
|
163
|
-
/**
|
|
164
|
-
* This format is a customized version of the implementation
|
|
165
|
-
* in `formattedVariables`. It applies some transformations
|
|
166
|
-
* to scss variables according to the conventions in demosplan-ui.
|
|
167
|
-
* See https://github.com/amzn/style-dictionary/blob/17f4cb2f30bd002dfd55d6ef8c5bee4138de8d64/lib/common/formatHelpers/formattedVariables.js#L46
|
|
168
|
-
*/
|
|
169
|
-
StyleDictionary.registerFormat({
|
|
170
|
-
name: 'scss/customVariables',
|
|
171
|
-
formatter: ({dictionary, options, file}) => {
|
|
172
|
-
const { outputReferences, themeable = false, formatting } = options
|
|
173
|
-
let { allTokens } = dictionary
|
|
174
|
-
|
|
175
|
-
if (outputReferences) {
|
|
176
|
-
allTokens = [...allTokens].sort(sortByReference(dictionary))
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
const propertyFormatter = createPropertyFormatter({ outputReferences, dictionary, format: 'sass', formatting, themeable })
|
|
180
|
-
|
|
181
|
-
const tokens = allTokens
|
|
182
|
-
.map(token => {
|
|
183
|
-
return transformTokenName(propertyFormatter(token), token.path, 'scss')
|
|
184
|
-
})
|
|
185
|
-
.filter(function(strVal) { return !!strVal })
|
|
186
|
-
.join('\n')
|
|
187
|
-
|
|
188
|
-
return fileHeader({file, commentStyle: 'short'}) + '\n' + tokens + '\n'
|
|
189
|
-
}
|
|
190
|
-
})
|
|
191
|
-
|
|
192
|
-
const StyleDictionaryExtended = StyleDictionary.extend({
|
|
193
|
-
source: [tokensPath],
|
|
194
|
-
platforms: {
|
|
195
|
-
scss: {
|
|
196
|
-
transformGroup: 'custom/scss',
|
|
197
|
-
prefix,
|
|
198
|
-
buildPath: 'tokens/dist/scss/',
|
|
199
|
-
files: files
|
|
200
|
-
.map((filePath) => {
|
|
201
|
-
return {
|
|
202
|
-
destination: `_${filePath}.scss`,
|
|
203
|
-
format: 'scss/customVariables',
|
|
204
|
-
filter: (token) => token.filePath.includes(filePath) && !token.filePath.includes('color.ui-tailwind'),
|
|
205
|
-
options: {
|
|
206
|
-
outputReferences: true
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
})
|
|
210
|
-
},
|
|
211
|
-
js: {
|
|
212
|
-
transformGroup: 'js',
|
|
213
|
-
buildPath: 'tokens/dist/js/',
|
|
214
|
-
files: files.map((filePath) => {
|
|
215
|
-
return {
|
|
216
|
-
destination: `${filePath}.js`,
|
|
217
|
-
format: 'javascript/module',
|
|
218
|
-
filter: (token) => {
|
|
219
|
-
return token.filePath.includes(filePath) && token.$status !== 'Deprecated'
|
|
220
|
-
},
|
|
221
|
-
options: {
|
|
222
|
-
outputReferences: true
|
|
223
|
-
}
|
|
224
|
-
}
|
|
225
|
-
})
|
|
226
|
-
},
|
|
227
|
-
web: {
|
|
228
|
-
transformGroup: 'custom/web',
|
|
229
|
-
buildPath: 'tokens/dist/tailwind/',
|
|
230
|
-
files: corePlugins.map((plugin) => {
|
|
231
|
-
return {
|
|
232
|
-
destination: `${plugin}.js`,
|
|
233
|
-
format: 'tailwind/variables'
|
|
234
|
-
}
|
|
235
|
-
}),
|
|
236
|
-
},
|
|
237
|
-
}
|
|
238
|
-
})
|
|
239
|
-
|
|
240
|
-
StyleDictionaryExtended.buildAllPlatforms()
|