@maggioli-design-system/mds-input-range 2.0.0 → 2.0.1
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/dist/cjs/mds-input-range.cjs.entry.js +4 -3
- package/dist/collection/common/aria.js +17 -1
- package/dist/collection/common/device.js +6 -0
- package/dist/collection/common/keyboard-manager.js +2 -2
- package/dist/collection/components/mds-input-range/mds-input-range.js +4 -3
- package/dist/collection/components/mds-input-range/test/mds-input-range.stories.js +4 -4
- package/dist/collection/dictionary/file-extensions.js +114 -56
- package/dist/collection/dictionary/text.js +60 -1
- package/dist/components/mds-input-range.js +4 -3
- package/dist/documentation.json +1 -1
- package/dist/esm/mds-input-range.entry.js +4 -3
- package/dist/esm-es5/mds-input-range.entry.js +1 -1
- package/dist/mds-input-range/mds-input-range.esm.js +1 -1
- package/dist/mds-input-range/{p-a84fc6af.system.entry.js → p-48fdc5db.system.entry.js} +1 -1
- package/dist/mds-input-range/p-76412b19.system.js +1 -1
- package/dist/mds-input-range/p-d697edb0.entry.js +1 -0
- package/dist/stats.json +19 -16
- package/dist/types/common/aria.d.ts +3 -1
- package/dist/types/common/device.d.ts +2 -0
- package/dist/types/components/mds-input-range/mds-input-range.d.ts +1 -0
- package/dist/types/components/mds-input-range/test/mds-input-range.stories.d.ts +0 -4
- package/dist/types/dictionary/text.d.ts +3 -1
- package/dist/types/type/text.d.ts +2 -0
- package/documentation.json +9 -4
- package/package.json +2 -2
- package/src/common/aria.ts +22 -2
- package/src/common/device.ts +9 -0
- package/src/common/keyboard-manager.ts +2 -2
- package/src/components/mds-input-range/mds-input-range.tsx +3 -0
- package/src/components/mds-input-range/test/mds-input-range.stories.tsx +4 -4
- package/src/dictionary/file-extensions.ts +115 -56
- package/src/dictionary/text.ts +64 -0
- package/src/fixtures/icons.json +8 -0
- package/src/fixtures/iconsauce.json +5 -0
- package/src/meta/file-format/locale.el.json +39 -0
- package/src/meta/file-format/locale.en.json +39 -0
- package/src/meta/file-format/locale.es.json +39 -0
- package/src/meta/file-format/locale.it.json +39 -0
- package/src/type/text.ts +59 -0
- package/www/build/mds-input-range.esm.js +1 -1
- package/www/build/{p-a84fc6af.system.entry.js → p-48fdc5db.system.entry.js} +1 -1
- package/www/build/p-76412b19.system.js +1 -1
- package/www/build/p-d697edb0.entry.js +1 -0
- package/dist/mds-input-range/p-b81446a9.entry.js +0 -1
- package/www/build/p-b81446a9.entry.js +0 -1
package/dist/stats.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"timestamp": "2024-
|
|
2
|
+
"timestamp": "2024-12-04T17:41:47",
|
|
3
3
|
"compiler": {
|
|
4
4
|
"name": "node",
|
|
5
5
|
"version": "22.11.0"
|
|
@@ -9,14 +9,15 @@
|
|
|
9
9
|
"fsNamespace": "mds-input-range",
|
|
10
10
|
"components": 1,
|
|
11
11
|
"entries": 1,
|
|
12
|
-
"bundles":
|
|
12
|
+
"bundles": 92,
|
|
13
13
|
"outputs": [
|
|
14
14
|
{
|
|
15
15
|
"name": "dist-collection",
|
|
16
|
-
"files":
|
|
16
|
+
"files": 44,
|
|
17
17
|
"generatedFiles": [
|
|
18
18
|
"./dist/collection/common/aria.js",
|
|
19
19
|
"./dist/collection/common/date.js",
|
|
20
|
+
"./dist/collection/common/device.js",
|
|
20
21
|
"./dist/collection/common/file.js",
|
|
21
22
|
"./dist/collection/common/icon.js",
|
|
22
23
|
"./dist/collection/common/keyboard-manager.js",
|
|
@@ -97,23 +98,23 @@
|
|
|
97
98
|
"./dist/mds-input-range/index.esm.js",
|
|
98
99
|
"./dist/mds-input-range/mds-input-range.esm.js",
|
|
99
100
|
"./dist/mds-input-range/mds-input-range.js",
|
|
101
|
+
"./dist/mds-input-range/p-48fdc5db.system.entry.js",
|
|
100
102
|
"./dist/mds-input-range/p-4e0b934e.system.js",
|
|
101
103
|
"./dist/mds-input-range/p-50ea2036.system.js",
|
|
102
104
|
"./dist/mds-input-range/p-56ba5cbf.system.js",
|
|
103
105
|
"./dist/mds-input-range/p-76412b19.system.js",
|
|
104
|
-
"./dist/mds-input-range/p-
|
|
105
|
-
"./dist/mds-input-range/p-b81446a9.entry.js",
|
|
106
|
+
"./dist/mds-input-range/p-d697edb0.entry.js",
|
|
106
107
|
"./dist/mds-input-range/p-e1255160.js",
|
|
107
108
|
"./dist/mds-input-range/p-f6cc8c2e.js",
|
|
108
109
|
"./www/build/index.esm.js",
|
|
109
110
|
"./www/build/mds-input-range.esm.js",
|
|
110
111
|
"./www/build/mds-input-range.js",
|
|
112
|
+
"./www/build/p-48fdc5db.system.entry.js",
|
|
111
113
|
"./www/build/p-4e0b934e.system.js",
|
|
112
114
|
"./www/build/p-50ea2036.system.js",
|
|
113
115
|
"./www/build/p-56ba5cbf.system.js",
|
|
114
116
|
"./www/build/p-76412b19.system.js",
|
|
115
|
-
"./www/build/p-
|
|
116
|
-
"./www/build/p-b81446a9.entry.js",
|
|
117
|
+
"./www/build/p-d697edb0.entry.js",
|
|
117
118
|
"./www/build/p-e1255160.js",
|
|
118
119
|
"./www/build/p-f6cc8c2e.js"
|
|
119
120
|
]
|
|
@@ -148,12 +149,12 @@
|
|
|
148
149
|
"components": [
|
|
149
150
|
"mds-input-range"
|
|
150
151
|
],
|
|
151
|
-
"bundleId": "p-
|
|
152
|
-
"fileName": "p-
|
|
152
|
+
"bundleId": "p-d697edb0",
|
|
153
|
+
"fileName": "p-d697edb0.entry.js",
|
|
153
154
|
"imports": [
|
|
154
155
|
"p-f6cc8c2e.js"
|
|
155
156
|
],
|
|
156
|
-
"originalByteSize":
|
|
157
|
+
"originalByteSize": 11095
|
|
157
158
|
}
|
|
158
159
|
],
|
|
159
160
|
"esm": [
|
|
@@ -167,7 +168,7 @@
|
|
|
167
168
|
"imports": [
|
|
168
169
|
"index-e0ac0a55.js"
|
|
169
170
|
],
|
|
170
|
-
"originalByteSize":
|
|
171
|
+
"originalByteSize": 11099
|
|
171
172
|
}
|
|
172
173
|
],
|
|
173
174
|
"es5": [
|
|
@@ -181,7 +182,7 @@
|
|
|
181
182
|
"imports": [
|
|
182
183
|
"index-e0ac0a55.js"
|
|
183
184
|
],
|
|
184
|
-
"originalByteSize":
|
|
185
|
+
"originalByteSize": 11099
|
|
185
186
|
}
|
|
186
187
|
],
|
|
187
188
|
"system": [
|
|
@@ -190,12 +191,12 @@
|
|
|
190
191
|
"components": [
|
|
191
192
|
"mds-input-range"
|
|
192
193
|
],
|
|
193
|
-
"bundleId": "p-
|
|
194
|
-
"fileName": "p-
|
|
194
|
+
"bundleId": "p-48fdc5db.system",
|
|
195
|
+
"fileName": "p-48fdc5db.system.entry.js",
|
|
195
196
|
"imports": [
|
|
196
197
|
"p-4e0b934e.system.js"
|
|
197
198
|
],
|
|
198
|
-
"originalByteSize":
|
|
199
|
+
"originalByteSize": 11787
|
|
199
200
|
}
|
|
200
201
|
],
|
|
201
202
|
"commonjs": [
|
|
@@ -209,7 +210,7 @@
|
|
|
209
210
|
"imports": [
|
|
210
211
|
"index-f984e289.js"
|
|
211
212
|
],
|
|
212
|
-
"originalByteSize":
|
|
213
|
+
"originalByteSize": 11200
|
|
213
214
|
}
|
|
214
215
|
]
|
|
215
216
|
},
|
|
@@ -602,6 +603,7 @@
|
|
|
602
603
|
"part",
|
|
603
604
|
"typography",
|
|
604
605
|
"style",
|
|
606
|
+
"aria-label",
|
|
605
607
|
"max",
|
|
606
608
|
"min",
|
|
607
609
|
"onInput",
|
|
@@ -640,6 +642,7 @@
|
|
|
640
642
|
"sourceGraph": {
|
|
641
643
|
"./src/common/aria.ts": [],
|
|
642
644
|
"./src/common/date.ts": [],
|
|
645
|
+
"./src/common/device.ts": [],
|
|
643
646
|
"./src/common/file.ts": [],
|
|
644
647
|
"./src/common/icon.ts": [],
|
|
645
648
|
"./src/common/keyboard-manager.ts": [],
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
declare const unslugName: (name: string) => string;
|
|
2
2
|
declare const setAttributeIfEmpty: (element: HTMLElement, attribute: string, value: string) => string;
|
|
3
|
+
declare const removeAttributesIf: (element: HTMLElement, attribute: string, valueCheck: string | undefined, cleanAttributes: string | string[]) => boolean;
|
|
4
|
+
declare const ifAttribute: (element: HTMLElement, attribute: string, valueCheck?: string) => boolean;
|
|
3
5
|
declare const hashValue: (value: string) => string;
|
|
4
6
|
declare const hashRandomValue: (value?: string) => string;
|
|
5
|
-
export {
|
|
7
|
+
export { hashRandomValue, hashValue, removeAttributesIf, setAttributeIfEmpty, ifAttribute, unslugName, };
|
|
@@ -4,28 +4,24 @@ declare const _default: {
|
|
|
4
4
|
min: {
|
|
5
5
|
type: {
|
|
6
6
|
name: string;
|
|
7
|
-
required: boolean;
|
|
8
7
|
};
|
|
9
8
|
description: string;
|
|
10
9
|
};
|
|
11
10
|
max: {
|
|
12
11
|
type: {
|
|
13
12
|
name: string;
|
|
14
|
-
required: boolean;
|
|
15
13
|
};
|
|
16
14
|
description: string;
|
|
17
15
|
};
|
|
18
16
|
step: {
|
|
19
17
|
type: {
|
|
20
18
|
name: string;
|
|
21
|
-
required: boolean;
|
|
22
19
|
};
|
|
23
20
|
description: string;
|
|
24
21
|
};
|
|
25
22
|
value: {
|
|
26
23
|
type: {
|
|
27
24
|
name: string;
|
|
28
|
-
required: boolean;
|
|
29
25
|
};
|
|
30
26
|
description: string;
|
|
31
27
|
};
|
|
@@ -1,2 +1,4 @@
|
|
|
1
|
+
declare const typographyTagDictionary: string[];
|
|
2
|
+
declare const typographyHeadingTagDictionary: string[];
|
|
1
3
|
declare const truncateDictionary: string[];
|
|
2
|
-
export { truncateDictionary, };
|
|
4
|
+
export { truncateDictionary, typographyHeadingTagDictionary, typographyTagDictionary, };
|
|
@@ -1 +1,3 @@
|
|
|
1
|
+
export type TypographyTagType = 'abbr' | 'address' | 'article' | 'b' | 'bdo' | 'blockquote' | 'cite' | 'code' | 'dd' | 'del' | 'details' | 'dfn' | 'div' | 'dl' | 'dt' | 'em' | 'figcaption' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'i' | 'ins' | 'kbd' | 'label' | 'legend' | 'li' | 'mark' | 'ol' | 'p' | 'pre' | 'q' | 'rb' | 'rt' | 'ruby' | 's' | 'samp' | 'small' | 'span' | 'strong' | 'sub' | 'summary' | 'sup' | 'time' | 'u' | 'ul' | 'var';
|
|
2
|
+
export type TypographyHeadingTagType = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
1
3
|
export type TypographyTruncateType = 'all' | 'none' | 'word';
|
package/documentation.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"timestamp": "2024-
|
|
2
|
+
"timestamp": "2024-12-04T15:30:05",
|
|
3
3
|
"compiler": {
|
|
4
4
|
"name": "@stencil/core",
|
|
5
5
|
"version": "4.22.2",
|
|
@@ -582,6 +582,11 @@
|
|
|
582
582
|
"docstring": "",
|
|
583
583
|
"path": "src/components/mds-push-notification/meta/event-detail.ts"
|
|
584
584
|
},
|
|
585
|
+
"src/type/text.ts::TypographyHeadingTagType": {
|
|
586
|
+
"declaration": "export type TypographyHeadingTagType =\n | 'h1'\n | 'h2'\n | 'h3'\n | 'h4'\n | 'h5'\n | 'h6'",
|
|
587
|
+
"docstring": "",
|
|
588
|
+
"path": "src/type/text.ts"
|
|
589
|
+
},
|
|
585
590
|
"src/components/mds-stepper-bar/meta/event-detail.ts::MdsStepperBarEventDetail": {
|
|
586
591
|
"declaration": "export interface MdsStepperBarEventDetail {\n step: number\n value: string\n}",
|
|
587
592
|
"docstring": "",
|
|
@@ -613,7 +618,7 @@
|
|
|
613
618
|
"path": "src/components/mds-tab-item/meta/event-detail.ts"
|
|
614
619
|
},
|
|
615
620
|
"src/components/mds-table-header-cell/meta/types.ts::SortDirectionType": {
|
|
616
|
-
"declaration": "export type SortDirectionType =\n | '
|
|
621
|
+
"declaration": "export type SortDirectionType =\n | 'ascending'\n | 'descending'\n | 'none'",
|
|
617
622
|
"docstring": "",
|
|
618
623
|
"path": "src/components/mds-table-header-cell/meta/types.ts"
|
|
619
624
|
},
|
|
@@ -622,10 +627,10 @@
|
|
|
622
627
|
"docstring": "",
|
|
623
628
|
"path": "src/components/mds-text/meta/types.ts"
|
|
624
629
|
},
|
|
625
|
-
"src/
|
|
630
|
+
"src/type/text.ts::TypographyTagType": {
|
|
626
631
|
"declaration": "export type TypographyTagType =\n | 'abbr'\n | 'address'\n | 'article'\n | 'b'\n | 'bdo'\n | 'blockquote'\n | 'cite'\n | 'code'\n | 'dd'\n | 'del'\n | 'details'\n | 'dfn'\n | 'div'\n | 'dl'\n | 'dt'\n | 'em'\n | 'figcaption'\n | 'h1'\n | 'h2'\n | 'h3'\n | 'h4'\n | 'h5'\n | 'h6'\n | 'i'\n | 'ins'\n | 'kbd'\n | 'label'\n | 'legend'\n | 'li'\n | 'mark'\n | 'ol'\n | 'p'\n | 'pre'\n | 'q'\n | 'rb'\n | 'rt'\n | 'ruby'\n | 's'\n | 'samp'\n | 'small'\n | 'span'\n | 'strong'\n | 'sub'\n | 'summary'\n | 'sup'\n | 'time'\n | 'u'\n | 'ul'\n | 'var'",
|
|
627
632
|
"docstring": "",
|
|
628
|
-
"path": "src/
|
|
633
|
+
"path": "src/type/text.ts"
|
|
629
634
|
},
|
|
630
635
|
"src/type/variant.ts::ThemeLuminanceVariantType": {
|
|
631
636
|
"declaration": "export type ThemeLuminanceVariantType =\n | 'dark'\n | 'light'",
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@maggioli-design-system/mds-input-range",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "mds-input-range is a web-component from Magma Design System, built with StencilJS, TypeScript, Storybook. It's based on the web-component standard and it's designed to be agnostic from the JavaScript framework you are using.",
|
|
5
5
|
"main": "dist/index.cjs.js",
|
|
6
6
|
"module": "dist/index.js",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@maggioli-design-system/styles": "15.5.0",
|
|
28
|
-
"@maggioli-design-system/mds-text": "4.5.
|
|
28
|
+
"@maggioli-design-system/mds-text": "4.5.2",
|
|
29
29
|
"@stencil/core": "4.22.2"
|
|
30
30
|
},
|
|
31
31
|
"license": "MIT",
|
package/src/common/aria.ts
CHANGED
|
@@ -20,6 +20,24 @@ const setAttributeIfEmpty = (element: HTMLElement, attribute: string, value: str
|
|
|
20
20
|
return value
|
|
21
21
|
}
|
|
22
22
|
|
|
23
|
+
const removeAttributesIf = (element: HTMLElement, attribute: string, valueCheck: string = 'true', cleanAttributes: string | string[]): boolean => {
|
|
24
|
+
if (ifAttribute(element, attribute, valueCheck)) {
|
|
25
|
+
const attributesList = Array.isArray(cleanAttributes) ? cleanAttributes : [cleanAttributes]
|
|
26
|
+
attributesList.forEach(attributeToRemove => {
|
|
27
|
+
element.removeAttribute(attributeToRemove)
|
|
28
|
+
})
|
|
29
|
+
return true
|
|
30
|
+
}
|
|
31
|
+
return false
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
const ifAttribute = (element: HTMLElement, attribute: string, valueCheck: string = 'true'): boolean => {
|
|
35
|
+
if (element.hasAttribute(attribute) && element.getAttribute(attribute) === valueCheck) {
|
|
36
|
+
return true
|
|
37
|
+
}
|
|
38
|
+
return false
|
|
39
|
+
}
|
|
40
|
+
|
|
23
41
|
const hashValue = (value: string): string => `${value}-${hash(value)}`
|
|
24
42
|
|
|
25
43
|
const hashRandomValue = (value?: string): string => {
|
|
@@ -32,8 +50,10 @@ const hashRandomValue = (value?: string): string => {
|
|
|
32
50
|
}
|
|
33
51
|
|
|
34
52
|
export {
|
|
35
|
-
unslugName,
|
|
36
|
-
setAttributeIfEmpty,
|
|
37
53
|
hashRandomValue,
|
|
38
54
|
hashValue,
|
|
55
|
+
removeAttributesIf,
|
|
56
|
+
setAttributeIfEmpty,
|
|
57
|
+
ifAttribute,
|
|
58
|
+
unslugName,
|
|
39
59
|
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
const isMobileDevice = (): boolean => {
|
|
2
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
3
|
+
const userAgent = navigator.userAgent || navigator.vendor || (window as any).opera
|
|
4
|
+
return /android|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(userAgent)
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export {
|
|
8
|
+
isMobileDevice,
|
|
9
|
+
}
|
|
@@ -36,14 +36,14 @@ export class KeyboardManager {
|
|
|
36
36
|
|
|
37
37
|
attachEscapeBehavior = (callback: () => void): void => {
|
|
38
38
|
this.escapeCallback = callback
|
|
39
|
-
if (window !== undefined) {
|
|
39
|
+
if (typeof window !== 'undefined') {
|
|
40
40
|
window.addEventListener('keydown', this.handleEscapeBehaviorDispatchEvent.bind(this))
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
|
|
44
44
|
detachEscapeBehavior = (): void => {
|
|
45
45
|
this.escapeCallback = () => { return }
|
|
46
|
-
if (window !== undefined) {
|
|
46
|
+
if (typeof window !== 'undefined') {
|
|
47
47
|
window.removeEventListener('keydown', this.handleEscapeBehaviorDispatchEvent.bind(this))
|
|
48
48
|
}
|
|
49
49
|
}
|
|
@@ -12,6 +12,7 @@ import { AttachInternals, Component, Element, Event, EventEmitter, Host, h, Prop
|
|
|
12
12
|
export class MdsInputRange {
|
|
13
13
|
|
|
14
14
|
@State() private progress: number
|
|
15
|
+
private label: string
|
|
15
16
|
private inputElement: HTMLInputElement
|
|
16
17
|
|
|
17
18
|
@Element() private element: HTMLMdsInputRangeElement
|
|
@@ -85,6 +86,7 @@ export class MdsInputRange {
|
|
|
85
86
|
}
|
|
86
87
|
|
|
87
88
|
componentDidLoad (): void {
|
|
89
|
+
this.label = this.element.textContent ?? ''
|
|
88
90
|
this.inputElement = this.element.shadowRoot?.querySelector('.field') as HTMLInputElement
|
|
89
91
|
this.value = parseInt(this.inputElement.value)
|
|
90
92
|
this.calculateProgress()
|
|
@@ -106,6 +108,7 @@ export class MdsInputRange {
|
|
|
106
108
|
</div>
|
|
107
109
|
<input
|
|
108
110
|
class="field"
|
|
111
|
+
aria-label={this.label}
|
|
109
112
|
max={this.max}
|
|
110
113
|
min={this.min}
|
|
111
114
|
onInput={this.onInput}
|
|
@@ -4,19 +4,19 @@ export default {
|
|
|
4
4
|
title: 'Form / Range',
|
|
5
5
|
argTypes: {
|
|
6
6
|
min: {
|
|
7
|
-
type: { name: 'number'
|
|
7
|
+
type: { name: 'number' },
|
|
8
8
|
description: 'The lowest value in the range of permitted values',
|
|
9
9
|
},
|
|
10
10
|
max: {
|
|
11
|
-
type: { name: 'number'
|
|
11
|
+
type: { name: 'number' },
|
|
12
12
|
description: 'The greatest value in the range of permitted values',
|
|
13
13
|
},
|
|
14
14
|
step: {
|
|
15
|
-
type: { name: 'number'
|
|
15
|
+
type: { name: 'number' },
|
|
16
16
|
description: 'The step attribute is a number that specifies the granularity that the value must adhere to, or the special value any, which is described below',
|
|
17
17
|
},
|
|
18
18
|
value: {
|
|
19
|
-
type: { name: 'number'
|
|
19
|
+
type: { name: 'number' },
|
|
20
20
|
description: 'The value attribute contains a number which contains a representation of the selected number',
|
|
21
21
|
},
|
|
22
22
|
},
|
|
@@ -11,64 +11,123 @@ interface ExtensionInfo {
|
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
const fileExtensionsDictionary: FileExtenstion = {
|
|
14
|
-
'7z': { format: 'archive', description: '
|
|
15
|
-
ace: { format: 'archive', description: '
|
|
16
|
-
ai: { format: 'vector', description: '
|
|
17
|
-
dart: { format: 'code', description: '
|
|
18
|
-
db: { format: 'data', description: '
|
|
19
|
-
default: { format: 'attachment', description: '
|
|
20
|
-
dmg: { format: 'executable', description: '
|
|
21
|
-
doc: { format: 'text', description: '
|
|
22
|
-
docm: { format: 'text', description: '
|
|
23
|
-
docx: { format: 'text', description: '
|
|
24
|
-
eml: { format: 'email', description: '
|
|
25
|
-
eps: { format: 'vector', description: '
|
|
26
|
-
exe: { format: 'executable', description: '
|
|
27
|
-
flac: { format: 'audio', description: '
|
|
28
|
-
gif: { format: 'image', description: '
|
|
29
|
-
htm: { format: 'markup', description: '
|
|
30
|
-
heic: { format: 'image', description: '
|
|
31
|
-
html: { format: 'markup', description: '
|
|
32
|
-
jpe: { format: 'image', description: '
|
|
33
|
-
jpeg: { format: 'image', description: '
|
|
34
|
-
jpg: { format: 'image', description: '
|
|
35
|
-
js: { format: 'code', description: '
|
|
36
|
-
json: { format: 'data', description: '
|
|
37
|
-
jsx: { format: 'code', description: '
|
|
38
|
-
m2v: { format: 'video', description: '
|
|
39
|
-
mp2: { format: 'audio', description: '
|
|
40
|
-
mp3: { format: 'audio', description: '
|
|
41
|
-
mp4: { format: 'video', description: '
|
|
42
|
-
mp4v: { format: 'video', description: '
|
|
43
|
-
mpeg: { format: 'video', description: '
|
|
44
|
-
mpg4: { format: 'video', description: '
|
|
45
|
-
mpg: { format: 'video', description: '
|
|
46
|
-
mpga: { format: 'audio', description: '
|
|
47
|
-
odp: { format: 'slide', description: '
|
|
48
|
-
ods: { format: 'spreadsheet', description: '
|
|
49
|
-
odt: { format: 'text', description: '
|
|
50
|
-
pdf: { format: 'document', description: '
|
|
51
|
-
php: { format: 'code', description: '
|
|
52
|
-
png: { format: 'image', description: '
|
|
53
|
-
ppt: { format: 'slide', description: '
|
|
54
|
-
rar: { format: 'archive', description: '
|
|
55
|
-
rtf: { format: 'text', description: '
|
|
56
|
-
sass: { format: 'code', description: '
|
|
57
|
-
shtml: { format: 'markup', description: '
|
|
58
|
-
svg: { format: 'vector', description: '
|
|
59
|
-
tar: { format: 'archive', description: '
|
|
60
|
-
tiff: { format: 'image', description: '
|
|
61
|
-
ts: { format: 'code', description: '
|
|
62
|
-
tsx: { format: 'code', description: '
|
|
63
|
-
txt: { format: 'text', description: '
|
|
64
|
-
wav: { format: 'audio', description: '
|
|
65
|
-
webp: { format: 'image', description: '
|
|
66
|
-
xar: { format: 'archive', description: '
|
|
67
|
-
xls: { format: 'spreadsheet', description: '
|
|
68
|
-
xlsx: { format: 'spreadsheet', description: '
|
|
69
|
-
zip: { format: 'archive', description: '
|
|
14
|
+
'7z': { format: 'archive', description: 'compressedArchive' },
|
|
15
|
+
ace: { format: 'archive', description: 'compressedArchive' },
|
|
16
|
+
ai: { format: 'vector', description: 'fileAI' },
|
|
17
|
+
dart: { format: 'code', description: 'dart' },
|
|
18
|
+
db: { format: 'data', description: 'fileDB' },
|
|
19
|
+
default: { format: 'attachment', description: 'unknown' },
|
|
20
|
+
dmg: { format: 'executable', description: 'appleDiskImage' },
|
|
21
|
+
doc: { format: 'text', description: 'documentMS' },
|
|
22
|
+
docm: { format: 'text', description: 'documentMS' },
|
|
23
|
+
docx: { format: 'text', description: 'compressedDocumentMS' },
|
|
24
|
+
eml: { format: 'email', description: 'email' },
|
|
25
|
+
eps: { format: 'vector', description: 'fileEPS' },
|
|
26
|
+
exe: { format: 'executable', description: 'fileEXE' },
|
|
27
|
+
flac: { format: 'audio', description: 'uncompressedAudio' },
|
|
28
|
+
gif: { format: 'image', description: 'compressedImage', preview: true },
|
|
29
|
+
htm: { format: 'markup', description: 'documentWeb' },
|
|
30
|
+
heic: { format: 'image', description: 'imageHEFF' },
|
|
31
|
+
html: { format: 'markup', description: 'documentWeb' },
|
|
32
|
+
jpe: { format: 'image', description: 'compressedImage', preview: true },
|
|
33
|
+
jpeg: { format: 'image', description: 'compressedImage', preview: true },
|
|
34
|
+
jpg: { format: 'image', description: 'compressedImage', preview: true },
|
|
35
|
+
js: { format: 'code', description: 'fileJS' },
|
|
36
|
+
json: { format: 'data', description: 'fileJSON' },
|
|
37
|
+
jsx: { format: 'code', description: 'fileJS' },
|
|
38
|
+
m2v: { format: 'video', description: 'videoSD' },
|
|
39
|
+
mp2: { format: 'audio', description: 'compressedAudio' },
|
|
40
|
+
mp3: { format: 'audio', description: 'compressedAudio' },
|
|
41
|
+
mp4: { format: 'video', description: 'videoHD' },
|
|
42
|
+
mp4v: { format: 'video', description: 'videoHD' },
|
|
43
|
+
mpeg: { format: 'video', description: 'videoSD' },
|
|
44
|
+
mpg4: { format: 'video', description: 'videoSD' },
|
|
45
|
+
mpg: { format: 'video', description: 'videoSD' },
|
|
46
|
+
mpga: { format: 'audio', description: 'compressedAudio' },
|
|
47
|
+
odp: { format: 'slide', description: 'slideLO' },
|
|
48
|
+
ods: { format: 'spreadsheet', description: 'spreadsheetLO' },
|
|
49
|
+
odt: { format: 'text', description: 'documentLO' },
|
|
50
|
+
pdf: { format: 'document', description: 'documentAdobe' },
|
|
51
|
+
php: { format: 'code', description: 'filePHP' },
|
|
52
|
+
png: { format: 'image', description: 'imagePNG', preview: true },
|
|
53
|
+
ppt: { format: 'slide', description: 'slidePowerPoint' },
|
|
54
|
+
rar: { format: 'archive', description: 'compressedArchive' },
|
|
55
|
+
rtf: { format: 'text', description: 'documentRTF' },
|
|
56
|
+
sass: { format: 'code', description: 'fileSASS' },
|
|
57
|
+
shtml: { format: 'markup', description: 'documentWeb' },
|
|
58
|
+
svg: { format: 'vector', description: 'imageSVG', preview: true },
|
|
59
|
+
tar: { format: 'archive', description: 'uncompressedArchive' },
|
|
60
|
+
tiff: { format: 'image', description: 'imageTIFF' },
|
|
61
|
+
ts: { format: 'code', description: 'fileTS' },
|
|
62
|
+
tsx: { format: 'code', description: 'fileTSX' },
|
|
63
|
+
txt: { format: 'text', description: 'documentTXT' },
|
|
64
|
+
wav: { format: 'audio', description: 'uncompressedAudio' },
|
|
65
|
+
webp: { format: 'image', description: 'imageWEBP', preview: true },
|
|
66
|
+
xar: { format: 'archive', description: 'compressedArchive' },
|
|
67
|
+
xls: { format: 'spreadsheet', description: 'spreadsheetMS' },
|
|
68
|
+
xlsx: { format: 'spreadsheet', description: 'spreadsheetMS' },
|
|
69
|
+
zip: { format: 'archive', description: 'compressedArchive' },
|
|
70
70
|
}
|
|
71
71
|
|
|
72
|
+
// const fileExtensionsDictionary: FileExtenstion = {
|
|
73
|
+
// '7z': { format: 'archive', description: 'Archivio compresso' },
|
|
74
|
+
// ace: { format: 'archive', description: 'Archivio compresso' },
|
|
75
|
+
// ai: { format: 'vector', description: 'Vettoriale Adobe Illustrator' },
|
|
76
|
+
// dart: { format: 'code', description: 'Dart' },
|
|
77
|
+
// db: { format: 'data', description: 'File di database' },
|
|
78
|
+
// default: { format: 'attachment', description: 'Formato sconosciuto' },
|
|
79
|
+
// dmg: { format: 'executable', description: 'Apple Disk Image' },
|
|
80
|
+
// doc: { format: 'text', description: 'Documento Microsoft Word' },
|
|
81
|
+
// docm: { format: 'text', description: 'Documento Microsoft Word' },
|
|
82
|
+
// docx: { format: 'text', description: 'Documento Microsoft Word Compresso' },
|
|
83
|
+
// eml: { format: 'email', description: 'E-mail di posta elettronica' },
|
|
84
|
+
// eps: { format: 'vector', description: 'Vettoriale Corel Draw' },
|
|
85
|
+
// exe: { format: 'executable', description: 'File eseguibile Windows' },
|
|
86
|
+
// flac: { format: 'audio', description: 'Audio non compresso' },
|
|
87
|
+
// gif: { format: 'image', description: 'Immagine compressa', preview: true },
|
|
88
|
+
// htm: { format: 'markup', description: 'Pagina web' },
|
|
89
|
+
// heic: { format: 'image', description: 'High Efficiency Image File Format' },
|
|
90
|
+
// html: { format: 'markup', description: 'Pagina web' },
|
|
91
|
+
// jpe: { format: 'image', description: 'Immagine compressa', preview: true },
|
|
92
|
+
// jpeg: { format: 'image', description: 'Immagine compressa', preview: true },
|
|
93
|
+
// jpg: { format: 'image', description: 'Immagine compressa', preview: true },
|
|
94
|
+
// js: { format: 'code', description: 'JavaScript' },
|
|
95
|
+
// json: { format: 'data', description: 'JavaScript Object Notation' },
|
|
96
|
+
// jsx: { format: 'code', description: 'JavaScript' },
|
|
97
|
+
// m2v: { format: 'video', description: 'Filmato SD' },
|
|
98
|
+
// mp2: { format: 'audio', description: 'Audio compresso' },
|
|
99
|
+
// mp3: { format: 'audio', description: 'Audio compresso' },
|
|
100
|
+
// mp4: { format: 'video', description: 'Filmato HD' },
|
|
101
|
+
// mp4v: { format: 'video', description: 'Filmato HD' },
|
|
102
|
+
// mpeg: { format: 'video', description: 'Filmato SD' },
|
|
103
|
+
// mpg4: { format: 'video', description: 'Filmato SD' },
|
|
104
|
+
// mpg: { format: 'video', description: 'Filmato SD' },
|
|
105
|
+
// mpga: { format: 'audio', description: 'Audio compresso' },
|
|
106
|
+
// odp: { format: 'slide', description: 'Slide di presentazione LibreOffice' },
|
|
107
|
+
// ods: { format: 'spreadsheet', description: 'Foglio di calcolo LibreOffice' },
|
|
108
|
+
// odt: { format: 'text', description: 'File di testo LibreOffice' },
|
|
109
|
+
// pdf: { format: 'document', description: 'Documento Adobe' },
|
|
110
|
+
// php: { format: 'code', description: 'Hypertext Preprocessor' },
|
|
111
|
+
// png: { format: 'image', description: 'Immagine Portable Network Graphics', preview: true },
|
|
112
|
+
// ppt: { format: 'slide', description: 'Slide di presentazione PowerPoint' },
|
|
113
|
+
// rar: { format: 'archive', description: 'Archivio compresso' },
|
|
114
|
+
// rtf: { format: 'text', description: 'Documento di testo Rich Text Format' },
|
|
115
|
+
// sass: { format: 'code', description: 'Syntactically Awesome StyleSheets' },
|
|
116
|
+
// shtml: { format: 'markup', description: 'Pagina web' },
|
|
117
|
+
// svg: { format: 'vector', description: 'Scalable Vector Graphics', preview: true },
|
|
118
|
+
// tar: { format: 'archive', description: 'Archivio non compresso' },
|
|
119
|
+
// tiff: { format: 'image', description: 'Tag Image File Format' },
|
|
120
|
+
// ts: { format: 'code', description: 'TypeScript' },
|
|
121
|
+
// tsx: { format: 'code', description: 'TypeScript Extended Syntax' },
|
|
122
|
+
// txt: { format: 'text', description: 'Documento di testo non formattato' },
|
|
123
|
+
// wav: { format: 'audio', description: 'Audio non compresso' },
|
|
124
|
+
// webp: { format: 'image', description: 'Immagine Web Picture', preview: true },
|
|
125
|
+
// xar: { format: 'archive', description: 'Archivio compresso' },
|
|
126
|
+
// xls: { format: 'spreadsheet', description: 'Foglio di calcolo Office' },
|
|
127
|
+
// xlsx: { format: 'spreadsheet', description: 'Foglio di calcolo Office' },
|
|
128
|
+
// zip: { format: 'archive', description: 'Archivio compresso' },
|
|
129
|
+
// }
|
|
130
|
+
|
|
72
131
|
const genericMimeToExt: Map<string, string[]> = new Map([
|
|
73
132
|
['image', ['.png', '.jpg', '.jpeg', '.tiff', '.webp', '.jpe', '.gif', '.heic']],
|
|
74
133
|
['audio', ['.mp2', '.mp3', '.mpga', '.wav', '.flac']],
|
package/src/dictionary/text.ts
CHANGED
|
@@ -1,3 +1,65 @@
|
|
|
1
|
+
const typographyTagDictionary = [
|
|
2
|
+
'abbr',
|
|
3
|
+
'address',
|
|
4
|
+
'article',
|
|
5
|
+
'b',
|
|
6
|
+
'bdo',
|
|
7
|
+
'blockquote',
|
|
8
|
+
'cite',
|
|
9
|
+
'code',
|
|
10
|
+
'dd',
|
|
11
|
+
'del',
|
|
12
|
+
'details',
|
|
13
|
+
'dfn',
|
|
14
|
+
'div',
|
|
15
|
+
'dl',
|
|
16
|
+
'dt',
|
|
17
|
+
'em',
|
|
18
|
+
'figcaption',
|
|
19
|
+
'h1',
|
|
20
|
+
'h2',
|
|
21
|
+
'h3',
|
|
22
|
+
'h4',
|
|
23
|
+
'h5',
|
|
24
|
+
'h6',
|
|
25
|
+
'i',
|
|
26
|
+
'ins',
|
|
27
|
+
'kbd',
|
|
28
|
+
'label',
|
|
29
|
+
'legend',
|
|
30
|
+
'li',
|
|
31
|
+
'mark',
|
|
32
|
+
'ol',
|
|
33
|
+
'p',
|
|
34
|
+
'pre',
|
|
35
|
+
'q',
|
|
36
|
+
'rb',
|
|
37
|
+
'rt',
|
|
38
|
+
'ruby',
|
|
39
|
+
's',
|
|
40
|
+
'samp',
|
|
41
|
+
'small',
|
|
42
|
+
'span',
|
|
43
|
+
'strong',
|
|
44
|
+
'sub',
|
|
45
|
+
'summary',
|
|
46
|
+
'sup',
|
|
47
|
+
'time',
|
|
48
|
+
'u',
|
|
49
|
+
'ul',
|
|
50
|
+
'var',
|
|
51
|
+
]
|
|
52
|
+
|
|
53
|
+
const typographyHeadingTagDictionary = [
|
|
54
|
+
'h1',
|
|
55
|
+
'h2',
|
|
56
|
+
'h3',
|
|
57
|
+
'h4',
|
|
58
|
+
'h5',
|
|
59
|
+
'h6',
|
|
60
|
+
]
|
|
61
|
+
|
|
62
|
+
|
|
1
63
|
const truncateDictionary = [
|
|
2
64
|
'all',
|
|
3
65
|
'none',
|
|
@@ -6,4 +68,6 @@ const truncateDictionary = [
|
|
|
6
68
|
|
|
7
69
|
export {
|
|
8
70
|
truncateDictionary,
|
|
71
|
+
typographyHeadingTagDictionary,
|
|
72
|
+
typographyTagDictionary,
|
|
9
73
|
}
|