@cling-se/widget 0.9.7 → 0.9.10
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/.env +11 -11
- package/README.md +35 -35
- package/dist/{AddClientCallout-22eea733.js → AddClientCallout-98b5d2c9.js} +5 -5
- package/dist/{AnswerModal-7441b8d3.js → AnswerModal-995e7a87.js} +7 -7
- package/dist/{AttachmentItem-34cd96fc.js → AttachmentItem-331b9c1e.js} +4 -4
- package/dist/{BaseDatePicker-5fcfcdcb.js → BaseDatePicker-7f047527.js} +1 -1
- package/dist/{BaseInput-c9d37ee6.js → BaseInput-c79f0001.js} +1 -1
- package/dist/{BaseUpload-8c9116a1.js → BaseUpload-9402cc1b.js} +3 -3
- package/dist/{BlockMedia-c0637f45.js → BlockMedia-80a082ed.js} +2 -2
- package/dist/{CCallout-d5efd737.js → CCallout-bd314caa.js} +6 -6
- package/dist/{CDropdownItem-32216ea8.js → CDropdownItem-ab42f924.js} +5 -5
- package/dist/{CField-b58cafce.js → CField-6da7299b.js} +1 -1
- package/dist/{CSlider.vue_vue_type_style_index_0_lang-a2818d05.js → CSlider.vue_vue_type_style_index_0_lang-c70342a2.js} +1 -1
- package/dist/{ClientAutocomplete-1569a879.js → ClientAutocomplete-67fc253c.js} +6 -6
- package/dist/{ClientModal-4ff2f08c.js → ClientModal-1709e8c7.js} +5 -5
- package/dist/{ColorPicker-4a830e26.js → ColorPicker-4880a624.js} +2 -2
- package/dist/{CompanyModal-a6d69d5f.js → CompanyModal-dbe85884.js} +4 -4
- package/dist/{ContentWrapper-8579f277.js → ContentWrapper-a602cc3d.js} +14 -14
- package/dist/{CoverBlockSettings-4284e111.js → CoverBlockSettings-f37fe6e1.js} +18 -18
- package/dist/DocAnswer-081e8239.js +33 -0
- package/dist/{DocForm-28752d98.js → DocForm-c69281fc.js} +186 -144
- package/dist/{DocFormSend-b7253ff4.js → DocFormSend-c9b955b9.js} +19 -18
- package/dist/{DocModalBase-a4f82cb3.js → DocModalBase-8c238a59.js} +4 -4
- package/dist/{DocPrint-54e0d308.js → DocPrint-2a181ffb.js} +5 -5
- package/dist/{DocReceipt-622afb67.js → DocReceipt-00c0f631.js} +1 -1
- package/dist/{DocSendReminder-2a4639e1.js → DocSendReminder-9effd808.js} +1 -1
- package/dist/{DocTextEditor-a795ba8d.js → DocTextEditor-0c8a4782.js} +12 -12
- package/dist/{DocTimeline-ea007937.js → DocTimeline-be5e8b9d.js} +1 -1
- package/dist/{DocumentClient-79f10a0e.js → DocumentClient-13f55b25.js} +5 -5
- package/dist/{DocumentLayout-3882fade.js → DocumentLayout-2ff55f9f.js} +120 -120
- package/dist/{DocumentLogotype-3dd2408b.js → DocumentLogotype-80a2521a.js} +6 -6
- package/dist/{EmbedInput-a748d1e5.js → EmbedInput-8572a42b.js} +2 -2
- package/dist/{EmbedSettings-2505d3fb.js → EmbedSettings-1a60358e.js} +5 -5
- package/dist/{ErrorCallout-ca6aa8a6.js → ErrorCallout-84e8168b.js} +2 -2
- package/dist/{FilePreviewModal-fbc76085.js → FilePreviewModal-cdafbf1c.js} +5 -5
- package/dist/{HeaderSettings-66f76d2b.js → HeaderSettings-9f4d182b.js} +15 -15
- package/dist/{ImageSelectModal-96c98a50.js → ImageSelectModal-b97c8185.js} +10 -10
- package/dist/{ImageUploadWrapper-706252ad.js → ImageUploadWrapper-ebcdbc9e.js} +3 -3
- package/dist/{Index-782f6e43.js → Index-0022bc40.js} +4 -4
- package/dist/{Index-6d960f1a.js → Index-0306a974.js} +12 -12
- package/dist/{Index-a777a7b4.js → Index-039d9c9d.js} +6 -6
- package/dist/{Index-f9ec7827.js → Index-0bbbe1cf.js} +11 -11
- package/dist/{Index-aac38d76.js → Index-0bd4a30c.js} +6 -6
- package/dist/{Index-ebc0f1dd.js → Index-11d16691.js} +22 -22
- package/dist/{Index-451a4720.js → Index-2ecefac2.js} +4 -4
- package/dist/{Index-2b1c5d21.js → Index-341f9388.js} +8 -8
- package/dist/{Index-0615e8dd.js → Index-3ccc66e4.js} +4 -4
- package/dist/{Index-774c1760.js → Index-451f5485.js} +5 -5
- package/dist/{Index-57ccc476.js → Index-473d0fad.js} +3 -3
- package/dist/{Index-0cb341e6.js → Index-4bbfdb2e.js} +2 -2
- package/dist/{Index-cab451ea.js → Index-5428e87c.js} +11 -11
- package/dist/{Index-aec49119.js → Index-623bb993.js} +4 -4
- package/dist/{Index-170e6883.js → Index-6c782bef.js} +12 -12
- package/dist/{Index-89c23ed7.js → Index-7b1fd376.js} +2 -2
- package/dist/{Index-a86877c9.js → Index-7f01697f.js} +7 -7
- package/dist/{Index-030436a2.js → Index-8053871b.js} +4 -4
- package/dist/{Index-ee710141.js → Index-8755440b.js} +5 -5
- package/dist/{Index-583792c4.js → Index-8c4fd5b4.js} +27 -27
- package/dist/{Index-fdac03a0.js → Index-8cba5dac.js} +26 -26
- package/dist/{Index-63872178.js → Index-8ecb9aa4.js} +2 -2
- package/dist/{Index-54b05e33.js → Index-8eff4eae.js} +2 -2
- package/dist/{Index-52979620.js → Index-95f0dd2f.js} +19 -19
- package/dist/{Index-ec7fe5df.js → Index-9c5f5d6e.js} +7 -7
- package/dist/{Index-813e0a59.js → Index-b233276b.js} +2 -2
- package/dist/{Index-ea43ed06.js → Index-ba4cfb80.js} +6 -6
- package/dist/{Index-2af3cf93.js → Index-c2b2ccd9.js} +8 -8
- package/dist/{Index-4f976bd6.js → Index-dca28212.js} +2 -2
- package/dist/{Index-8e3a0d81.js → Index-dd30bbc5.js} +12 -12
- package/dist/{Index-2a568234.js → Index-ddf49640.js} +6 -6
- package/dist/{Index-3cfea400.js → Index-de93e029.js} +7 -7
- package/dist/{Index-d9307e92.js → Index-f9063054.js} +7 -7
- package/dist/{Index-cc243c40.js → Index-ffc7dba1.js} +5 -5
- package/dist/{InputToggleRow-3764a034.js → InputToggleRow-533651e6.js} +2 -2
- package/dist/{IsPremiumPreStep-310fc507.js → IsPremiumPreStep-8d46fadc.js} +248 -242
- package/dist/{MediaWrapper-ac4d559e.js → MediaWrapper-388589e5.js} +3 -3
- package/dist/{NotBindingText-9d926894.js → NotBindingText-b833c49b.js} +2 -2
- package/dist/{PackageGroup-11132495.js → PackageGroup-41b2d524.js} +15 -15
- package/dist/{PdfTerms-5567e1d9.js → PdfTerms-461fcd9e.js} +7 -7
- package/dist/{PdfViewer-6e5442ae.js → PdfViewer-099b598c.js} +2 -2
- package/dist/{PlainHtml-3a94783a.js → PlainHtml-37aa5b7b.js} +1 -1
- package/dist/PriceHeader-41c48787.js +337 -0
- package/dist/{SearchApi-66a3369e.js → SearchApi-25909227.js} +2 -2
- package/dist/{TermsSettings-42464249.js → TermsSettings-c730ac70.js} +10 -10
- package/dist/{ThemeColorRow-4c02f3cf.js → ThemeColorRow-31d8285b.js} +3 -3
- package/dist/{ToggleBinding-53a84127.js → ToggleBinding-1a98360f.js} +3 -3
- package/dist/{UploadModal-7d2c2dcc.js → UploadModal-e0a37c3e.js} +4 -4
- package/dist/{VideoPlayerInput-d53ffa5e.js → VideoPlayerInput-4d7f302a.js} +3 -3
- package/dist/{VideoPlayerSettings-d89173c1.js → VideoPlayerSettings-81168a6b.js} +5 -5
- package/dist/{VideoSelectModal-1b2f9e2f.js → VideoSelectModal-dc429ff0.js} +28 -28
- package/dist/{answerDocumentMixin-3e4ed95e.js → answerDocumentMixin-3ff2b25d.js} +3 -3
- package/dist/{cssMode-f680359e.js → cssMode-c6b1b286.js} +7 -7
- package/dist/{focusDrawerMixin-7cf9e926.js → focusDrawerMixin-01b547f0.js} +1 -1
- package/dist/{formComponentsInstall-60696be3.js → formComponentsInstall-9e33cb8f.js} +20 -20
- package/dist/{formValidationMixin-5d709c26.js → formValidationMixin-74c239ee.js} +1 -1
- package/dist/{freemarker2-06443b0a.js → freemarker2-076519a0.js} +7 -7
- package/dist/{handlebars-0d8766bf.js → handlebars-bb155717.js} +7 -7
- package/dist/{html-81ed4c26.js → html-1cf008d9.js} +7 -7
- package/dist/{htmlMode-3be0b9fd.js → htmlMode-bf67fa2b.js} +7 -7
- package/dist/{index-eab9b762.js → index-0f09ca1c.js} +1 -1
- package/dist/{index-fe745f0b.js → index-7097f05c.js} +10 -10
- package/dist/{index-3ca26b2c.js → index-908333a3.js} +9 -9
- package/dist/{index-7964f39c.js → index-e37214e9.js} +3 -3
- package/dist/index.es.js +3 -3
- package/dist/index.umd.js +496 -493
- package/dist/{javascript-da51eff4.js → javascript-b98377f9.js} +8 -8
- package/dist/{jsonMode-f69b77fa.js → jsonMode-e9595a57.js} +7 -7
- package/dist/{liquid-4c01bc35.js → liquid-b60636e3.js} +7 -7
- package/dist/{main-8c6aae3a.js → main-cf622dd3.js} +26108 -26001
- package/dist/{mapFormMixin-fe8972cd.js → mapFormMixin-490a1765.js} +1 -1
- package/dist/{publicSenderState-9cd2ff24.js → publicSenderState-6b369e21.js} +1 -1
- package/dist/{python-48563b51.js → python-4e4d18f5.js} +7 -7
- package/dist/{razor-3e2ef5a9.js → razor-63ead89f.js} +7 -7
- package/dist/{simplebar.min-baa28a2a.js → simplebar.min-3f1edc12.js} +1 -1
- package/dist/style.css +2 -2
- package/dist/{template-c64eadf9.js → template-66eba036.js} +1 -1
- package/dist/throttle-2b45d29c.js +18 -0
- package/dist/{tinycolor-c5753ad0.js → tinycolor-9f3cc25c.js} +1 -1
- package/dist/{tippy.esm-495f26e4.js → tippy.esm-dec03596.js} +7 -7
- package/dist/{tsMode-15587c3c.js → tsMode-e93504e4.js} +7 -7
- package/dist/{typescript-ebb43ca2.js → typescript-111230d0.js} +7 -7
- package/dist/{utils-8c0b7aab.js → utils-fb02e603.js} +1 -1
- package/dist/{vuedraggable.umd-45109ca7.js → vuedraggable.umd-f2d6d3e3.js} +1 -1
- package/dist/{xml-d34c22ca.js → xml-987e33cc.js} +7 -7
- package/jsconfig.json +11 -11
- package/package.json +4 -2
- package/postcss.config.cjs +6 -6
- package/stats.html +1 -1
- package/tailwind.config.cjs +26 -26
- package/vite-plugin-library-asset-external/index.js +134 -134
- package/dist/DocAnswer-bf72cfd4.js +0 -46
- package/dist/PriceHeader-c5053109.js +0 -337
- package/dist/throttle-f8302435.js +0 -18
package/tailwind.config.cjs
CHANGED
|
@@ -1,26 +1,26 @@
|
|
|
1
|
-
/** @type {import('tailwindcss').Config} */
|
|
2
|
-
const defaultTheme = require('tailwindcss/defaultTheme');
|
|
3
|
-
const sharedTailwindConfig = require('../shared/tailwind')
|
|
4
|
-
|
|
5
|
-
module.exports = {
|
|
6
|
-
content: [
|
|
7
|
-
'./index.html',
|
|
8
|
-
'./src/*.{js,ts,jsx,tsx,vue}',
|
|
9
|
-
'./src/**/*.{js,ts,jsx,tsx,vue}',
|
|
10
|
-
'../core/src/**/*.{vue,js,ts,jsx,tsx}'
|
|
11
|
-
],
|
|
12
|
-
theme: {
|
|
13
|
-
...sharedTailwindConfig.theme,
|
|
14
|
-
borderRadius: sharedTailwindConfig.rem2px(defaultTheme.borderRadius),
|
|
15
|
-
columns: sharedTailwindConfig.rem2px(defaultTheme.columns),
|
|
16
|
-
fontSize: sharedTailwindConfig.rem2px(defaultTheme.fontSize),
|
|
17
|
-
lineHeight: sharedTailwindConfig.rem2px(defaultTheme.lineHeight),
|
|
18
|
-
maxWidth: ({ theme, breakpoints }) => ({
|
|
19
|
-
...sharedTailwindConfig.rem2px(
|
|
20
|
-
defaultTheme.maxWidth({ theme, breakpoints })
|
|
21
|
-
)
|
|
22
|
-
}),
|
|
23
|
-
spacing: sharedTailwindConfig.rem2px(defaultTheme.spacing),
|
|
24
|
-
},
|
|
25
|
-
plugins: sharedTailwindConfig.plugins,
|
|
26
|
-
}
|
|
1
|
+
/** @type {import('tailwindcss').Config} */
|
|
2
|
+
const defaultTheme = require('tailwindcss/defaultTheme');
|
|
3
|
+
const sharedTailwindConfig = require('../shared/tailwind')
|
|
4
|
+
|
|
5
|
+
module.exports = {
|
|
6
|
+
content: [
|
|
7
|
+
'./index.html',
|
|
8
|
+
'./src/*.{js,ts,jsx,tsx,vue}',
|
|
9
|
+
'./src/**/*.{js,ts,jsx,tsx,vue}',
|
|
10
|
+
'../core/src/**/*.{vue,js,ts,jsx,tsx}'
|
|
11
|
+
],
|
|
12
|
+
theme: {
|
|
13
|
+
...sharedTailwindConfig.theme,
|
|
14
|
+
borderRadius: sharedTailwindConfig.rem2px(defaultTheme.borderRadius),
|
|
15
|
+
columns: sharedTailwindConfig.rem2px(defaultTheme.columns),
|
|
16
|
+
fontSize: sharedTailwindConfig.rem2px(defaultTheme.fontSize),
|
|
17
|
+
lineHeight: sharedTailwindConfig.rem2px(defaultTheme.lineHeight),
|
|
18
|
+
maxWidth: ({ theme, breakpoints }) => ({
|
|
19
|
+
...sharedTailwindConfig.rem2px(
|
|
20
|
+
defaultTheme.maxWidth({ theme, breakpoints })
|
|
21
|
+
)
|
|
22
|
+
}),
|
|
23
|
+
spacing: sharedTailwindConfig.rem2px(defaultTheme.spacing),
|
|
24
|
+
},
|
|
25
|
+
plugins: sharedTailwindConfig.plugins,
|
|
26
|
+
}
|
|
@@ -1,134 +1,134 @@
|
|
|
1
|
-
// This plugin is used to externalize assets in a library build.
|
|
2
|
-
// It is used to include images in the library build.
|
|
3
|
-
// Taken from https://gist.github.com/ZKHelloworld/4d518583b90ddcb4762d49c102a42054
|
|
4
|
-
|
|
5
|
-
/* eslint-disable no-continue */
|
|
6
|
-
/* eslint-disable no-await-in-loop */
|
|
7
|
-
/* eslint-disable prefer-const */
|
|
8
|
-
/* eslint-disable no-param-reassign */
|
|
9
|
-
/* eslint-disable no-shadow */
|
|
10
|
-
/* eslint-disable no-bitwise */
|
|
11
|
-
import path from 'path'
|
|
12
|
-
import fs from 'fs'
|
|
13
|
-
import { generate } from 'astring'
|
|
14
|
-
|
|
15
|
-
// interface Options {
|
|
16
|
-
// test: RegExp;
|
|
17
|
-
// include: string[];
|
|
18
|
-
// dir: string;
|
|
19
|
-
// }
|
|
20
|
-
|
|
21
|
-
function hash(src) {
|
|
22
|
-
let hash = 0
|
|
23
|
-
let i
|
|
24
|
-
let chr
|
|
25
|
-
if (src.length === 0) {
|
|
26
|
-
return ''
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
for (i = 0; i < src.length; i++) {
|
|
30
|
-
chr = src.charCodeAt(i)
|
|
31
|
-
hash = (hash << 5) - hash + chr
|
|
32
|
-
hash |= 0 // Convert to 32bit integer
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
return Math.abs(hash).toString().substring(0, 5)
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
function generateFileNameWithHash(fileName, filePath) {
|
|
39
|
-
if (!fileName) {
|
|
40
|
-
return ''
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
return `${path.parse(fileName).name}-${hash(filePath)}${
|
|
44
|
-
path.parse(fileName).ext
|
|
45
|
-
}`
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
export default function vitePluginLibraryAssetExternal(options) {
|
|
49
|
-
let aliasPlugin
|
|
50
|
-
let outputDir
|
|
51
|
-
|
|
52
|
-
return {
|
|
53
|
-
name: 'vite-plugin-library-asset-external',
|
|
54
|
-
config(config) {
|
|
55
|
-
if (config?.build?.rollupOptions?.external) {
|
|
56
|
-
config.build.rollupOptions.external.push(options.test)
|
|
57
|
-
} else {
|
|
58
|
-
config.build.rollupOptions.external = [options.test]
|
|
59
|
-
}
|
|
60
|
-
},
|
|
61
|
-
configResolved(config) {
|
|
62
|
-
outputDir = path.resolve(config.root, config.build.outDir)
|
|
63
|
-
},
|
|
64
|
-
buildStart({ plugins }) {
|
|
65
|
-
aliasPlugin = plugins.find(p => p.name === 'alias')
|
|
66
|
-
},
|
|
67
|
-
async transform(src, id) {
|
|
68
|
-
if (options.include.indexOf(path.extname(id)) === -1) {
|
|
69
|
-
return null
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
let transformed = false
|
|
73
|
-
|
|
74
|
-
// iterate every import declaration
|
|
75
|
-
const ast = this.parse(src)
|
|
76
|
-
for (let node of ast?.body || []) {
|
|
77
|
-
if (node.type !== 'ImportDeclaration') {
|
|
78
|
-
continue
|
|
79
|
-
}
|
|
80
|
-
if (!options.test.test(node.source.value)) {
|
|
81
|
-
continue
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
let assetInfo
|
|
85
|
-
if (aliasPlugin) {
|
|
86
|
-
assetInfo = await aliasPlugin.resolveId.call(
|
|
87
|
-
this,
|
|
88
|
-
node.source.value,
|
|
89
|
-
id
|
|
90
|
-
)
|
|
91
|
-
}
|
|
92
|
-
if (!assetInfo) {
|
|
93
|
-
assetInfo = await this.resolve(node.source.value, id)
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
if (!assetInfo) {
|
|
97
|
-
this.error(
|
|
98
|
-
`[vite-plugin-library-asset-external] resolve asset failed, importee: ${node.source.value} importer: ${id}`
|
|
99
|
-
)
|
|
100
|
-
continue
|
|
101
|
-
}
|
|
102
|
-
if (!assetInfo.external) {
|
|
103
|
-
continue
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
const fileName = generateFileNameWithHash(
|
|
107
|
-
path.basename(assetInfo.id),
|
|
108
|
-
assetInfo.id
|
|
109
|
-
)
|
|
110
|
-
const assetName = `${options.dir}/${fileName}`
|
|
111
|
-
|
|
112
|
-
await this.emitFile({
|
|
113
|
-
type: 'asset',
|
|
114
|
-
name: assetName,
|
|
115
|
-
source: fs.readFileSync(assetInfo.id)
|
|
116
|
-
})
|
|
117
|
-
|
|
118
|
-
const outputAssetPath = path.join(outputDir, assetName)
|
|
119
|
-
node.source.value = `${outputAssetPath}`
|
|
120
|
-
node.source.raw = `"${outputAssetPath}"`
|
|
121
|
-
|
|
122
|
-
transformed = true
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
if (!transformed) {
|
|
126
|
-
return null
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
return {
|
|
130
|
-
code: generate(ast)
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
1
|
+
// This plugin is used to externalize assets in a library build.
|
|
2
|
+
// It is used to include images in the library build.
|
|
3
|
+
// Taken from https://gist.github.com/ZKHelloworld/4d518583b90ddcb4762d49c102a42054
|
|
4
|
+
|
|
5
|
+
/* eslint-disable no-continue */
|
|
6
|
+
/* eslint-disable no-await-in-loop */
|
|
7
|
+
/* eslint-disable prefer-const */
|
|
8
|
+
/* eslint-disable no-param-reassign */
|
|
9
|
+
/* eslint-disable no-shadow */
|
|
10
|
+
/* eslint-disable no-bitwise */
|
|
11
|
+
import path from 'path'
|
|
12
|
+
import fs from 'fs'
|
|
13
|
+
import { generate } from 'astring'
|
|
14
|
+
|
|
15
|
+
// interface Options {
|
|
16
|
+
// test: RegExp;
|
|
17
|
+
// include: string[];
|
|
18
|
+
// dir: string;
|
|
19
|
+
// }
|
|
20
|
+
|
|
21
|
+
function hash(src) {
|
|
22
|
+
let hash = 0
|
|
23
|
+
let i
|
|
24
|
+
let chr
|
|
25
|
+
if (src.length === 0) {
|
|
26
|
+
return ''
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
for (i = 0; i < src.length; i++) {
|
|
30
|
+
chr = src.charCodeAt(i)
|
|
31
|
+
hash = (hash << 5) - hash + chr
|
|
32
|
+
hash |= 0 // Convert to 32bit integer
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return Math.abs(hash).toString().substring(0, 5)
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
function generateFileNameWithHash(fileName, filePath) {
|
|
39
|
+
if (!fileName) {
|
|
40
|
+
return ''
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
return `${path.parse(fileName).name}-${hash(filePath)}${
|
|
44
|
+
path.parse(fileName).ext
|
|
45
|
+
}`
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export default function vitePluginLibraryAssetExternal(options) {
|
|
49
|
+
let aliasPlugin
|
|
50
|
+
let outputDir
|
|
51
|
+
|
|
52
|
+
return {
|
|
53
|
+
name: 'vite-plugin-library-asset-external',
|
|
54
|
+
config(config) {
|
|
55
|
+
if (config?.build?.rollupOptions?.external) {
|
|
56
|
+
config.build.rollupOptions.external.push(options.test)
|
|
57
|
+
} else {
|
|
58
|
+
config.build.rollupOptions.external = [options.test]
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
configResolved(config) {
|
|
62
|
+
outputDir = path.resolve(config.root, config.build.outDir)
|
|
63
|
+
},
|
|
64
|
+
buildStart({ plugins }) {
|
|
65
|
+
aliasPlugin = plugins.find(p => p.name === 'alias')
|
|
66
|
+
},
|
|
67
|
+
async transform(src, id) {
|
|
68
|
+
if (options.include.indexOf(path.extname(id)) === -1) {
|
|
69
|
+
return null
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
let transformed = false
|
|
73
|
+
|
|
74
|
+
// iterate every import declaration
|
|
75
|
+
const ast = this.parse(src)
|
|
76
|
+
for (let node of ast?.body || []) {
|
|
77
|
+
if (node.type !== 'ImportDeclaration') {
|
|
78
|
+
continue
|
|
79
|
+
}
|
|
80
|
+
if (!options.test.test(node.source.value)) {
|
|
81
|
+
continue
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
let assetInfo
|
|
85
|
+
if (aliasPlugin) {
|
|
86
|
+
assetInfo = await aliasPlugin.resolveId.call(
|
|
87
|
+
this,
|
|
88
|
+
node.source.value,
|
|
89
|
+
id
|
|
90
|
+
)
|
|
91
|
+
}
|
|
92
|
+
if (!assetInfo) {
|
|
93
|
+
assetInfo = await this.resolve(node.source.value, id)
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
if (!assetInfo) {
|
|
97
|
+
this.error(
|
|
98
|
+
`[vite-plugin-library-asset-external] resolve asset failed, importee: ${node.source.value} importer: ${id}`
|
|
99
|
+
)
|
|
100
|
+
continue
|
|
101
|
+
}
|
|
102
|
+
if (!assetInfo.external) {
|
|
103
|
+
continue
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
const fileName = generateFileNameWithHash(
|
|
107
|
+
path.basename(assetInfo.id),
|
|
108
|
+
assetInfo.id
|
|
109
|
+
)
|
|
110
|
+
const assetName = `${options.dir}/${fileName}`
|
|
111
|
+
|
|
112
|
+
await this.emitFile({
|
|
113
|
+
type: 'asset',
|
|
114
|
+
name: assetName,
|
|
115
|
+
source: fs.readFileSync(assetInfo.id)
|
|
116
|
+
})
|
|
117
|
+
|
|
118
|
+
const outputAssetPath = path.join(outputDir, assetName)
|
|
119
|
+
node.source.value = `${outputAssetPath}`
|
|
120
|
+
node.source.raw = `"${outputAssetPath}"`
|
|
121
|
+
|
|
122
|
+
transformed = true
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
if (!transformed) {
|
|
126
|
+
return null
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
return {
|
|
130
|
+
code: generate(ast)
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import { u as s, b as a, n as m } from "./main-8c6aae3a.js";
|
|
2
|
-
import c from "./AnswerModal-7441b8d3.js";
|
|
3
|
-
import "./anime.es-e284c852.js";
|
|
4
|
-
import "./vuex.esm-4a0fff7c.js";
|
|
5
|
-
import "./mapFormMixin-fe8972cd.js";
|
|
6
|
-
import "./CField-b58cafce.js";
|
|
7
|
-
import "./CField.vue_vue_type_style_index_0_lang-4ed993c7.js";
|
|
8
|
-
const u = (t, e) => ({
|
|
9
|
-
...t,
|
|
10
|
-
[e]: (n) => {
|
|
11
|
-
var o, r;
|
|
12
|
-
return ((o = n.params) == null ? void 0 : o[e]) || ((r = n.meta) == null ? void 0 : r[e]);
|
|
13
|
-
}
|
|
14
|
-
}), p = {
|
|
15
|
-
components: {
|
|
16
|
-
AnswerModal: c
|
|
17
|
-
},
|
|
18
|
-
data() {
|
|
19
|
-
return { ui: s };
|
|
20
|
-
},
|
|
21
|
-
computed: {
|
|
22
|
-
...a(
|
|
23
|
-
"route",
|
|
24
|
-
["answerType", "document"].reduce(u, {})
|
|
25
|
-
)
|
|
26
|
-
}
|
|
27
|
-
};
|
|
28
|
-
var l = function() {
|
|
29
|
-
var e = this, n = e._self._c;
|
|
30
|
-
return n("AnswerModal", { attrs: { mode: e.answerType, _document: e.document }, on: { close: function(o) {
|
|
31
|
-
e.ui.open = !1;
|
|
32
|
-
} } });
|
|
33
|
-
}, i = [], _ = /* @__PURE__ */ m(
|
|
34
|
-
p,
|
|
35
|
-
l,
|
|
36
|
-
i,
|
|
37
|
-
!1,
|
|
38
|
-
null,
|
|
39
|
-
null,
|
|
40
|
-
null,
|
|
41
|
-
null
|
|
42
|
-
);
|
|
43
|
-
const M = _.exports;
|
|
44
|
-
export {
|
|
45
|
-
M as default
|
|
46
|
-
};
|