@uzum-tech/ui 1.12.5 → 1.12.7
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/index.js +55 -52
- package/dist/index.prod.js +2 -2
- package/es/_internal/typography/index.d.ts +5 -1
- package/es/_internal/typography/src/text.d.ts +9 -0
- package/es/_internal/typography/src/text.js +7 -4
- package/es/_internal/typography/src/variants.d.ts +14 -14
- package/es/_internal/typography/src/variants.js +40 -48
- package/es/chat/index.d.ts +2 -2
- package/es/chat/index.js +1 -1
- package/es/chat/src/ChatParts/MainArea.js +1 -1
- package/es/typography/index.d.ts +5 -1
- package/es/version.d.ts +1 -1
- package/es/version.js +1 -1
- package/lib/_internal/typography/index.d.ts +5 -1
- package/lib/_internal/typography/src/text.d.ts +9 -0
- package/lib/_internal/typography/src/text.js +7 -4
- package/lib/_internal/typography/src/variants.d.ts +14 -14
- package/lib/_internal/typography/src/variants.js +40 -49
- package/lib/chat/index.d.ts +2 -2
- package/lib/chat/index.js +2 -1
- package/lib/chat/src/ChatParts/MainArea.js +1 -1
- package/lib/typography/index.d.ts +5 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/package.json +1 -1
- package/web-types.json +3 -3
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
export { default as InternalUText, internalTextProps } from './src/text';
|
|
2
2
|
export type { InternalTextProps } from './src/text';
|
|
3
|
-
export type { TypographyVariant, TypographyVariantOptions,
|
|
3
|
+
export type { TypographyVariant, TypographyVariantOptions,
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Weight options are fixed; override via `variantOptions` instead.
|
|
6
|
+
*/
|
|
7
|
+
TypographyVariantWeightsOptions } from './src/variants';
|
|
@@ -25,6 +25,9 @@ export declare const internalTextProps: {
|
|
|
25
25
|
readonly type: PropType<TypographyVariantOptions>;
|
|
26
26
|
readonly default: () => {};
|
|
27
27
|
};
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated Weight options are fixed internally; kept for backwards compatibility.
|
|
30
|
+
*/
|
|
28
31
|
readonly variantWeightsOptions: {
|
|
29
32
|
readonly type: PropType<TypographyVariantWeightsOptions>;
|
|
30
33
|
readonly default: () => {};
|
|
@@ -114,6 +117,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
114
117
|
readonly type: PropType<TypographyVariantOptions>;
|
|
115
118
|
readonly default: () => {};
|
|
116
119
|
};
|
|
120
|
+
/**
|
|
121
|
+
* @deprecated Weight options are fixed internally; kept for backwards compatibility.
|
|
122
|
+
*/
|
|
117
123
|
readonly variantWeightsOptions: {
|
|
118
124
|
readonly type: PropType<TypographyVariantWeightsOptions>;
|
|
119
125
|
readonly default: () => {};
|
|
@@ -207,6 +213,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
207
213
|
readonly type: PropType<TypographyVariantOptions>;
|
|
208
214
|
readonly default: () => {};
|
|
209
215
|
};
|
|
216
|
+
/**
|
|
217
|
+
* @deprecated Weight options are fixed internally; kept for backwards compatibility.
|
|
218
|
+
*/
|
|
210
219
|
readonly variantWeightsOptions: {
|
|
211
220
|
readonly type: PropType<TypographyVariantWeightsOptions>;
|
|
212
221
|
readonly default: () => {};
|
|
@@ -22,7 +22,11 @@ export const internalTextProps = Object.assign(Object.assign({}, useTheme.props)
|
|
|
22
22
|
}, variantOptions: {
|
|
23
23
|
type: Object,
|
|
24
24
|
default: () => ({})
|
|
25
|
-
},
|
|
25
|
+
},
|
|
26
|
+
/**
|
|
27
|
+
* @deprecated Weight options are fixed internally; kept for backwards compatibility.
|
|
28
|
+
*/
|
|
29
|
+
variantWeightsOptions: {
|
|
26
30
|
type: Object,
|
|
27
31
|
default: () => ({})
|
|
28
32
|
}, strong: Boolean, italic: Boolean, underline: Boolean, strikethrough: Boolean });
|
|
@@ -54,14 +58,13 @@ export default defineComponent({
|
|
|
54
58
|
'--u-margin': margin,
|
|
55
59
|
'--u-prefix-color': blockquotePrefixColor
|
|
56
60
|
};
|
|
57
|
-
return getVariantCssVars(variant, baseVars, fontFamilyWixMadeforDisplay, props.variantOptions
|
|
61
|
+
return getVariantCssVars(variant, baseVars, fontFamilyWixMadeforDisplay, props.variantOptions);
|
|
58
62
|
});
|
|
59
63
|
const themeClassHandle = inlineThemeDisabled
|
|
60
64
|
? useThemeClass('text', computed(() => `${(props === null || props === void 0 ? void 0 : props.variant) || ''}${(props === null || props === void 0 ? void 0 : props.tag) || ''}`), cssVarsRef, props)
|
|
61
65
|
: undefined;
|
|
62
66
|
const tagToRender = props.tag ||
|
|
63
|
-
(props.variant &&
|
|
64
|
-
getVariantTag(props.variant, props.variantOptions, props.variantWeightsOptions)) ||
|
|
67
|
+
(props.variant && getVariantTag(props.variant, props.variantOptions)) ||
|
|
65
68
|
'span';
|
|
66
69
|
return {
|
|
67
70
|
mergedClsPrefix: mergedClsPrefixRef,
|
|
@@ -2,9 +2,13 @@ export interface TypographyVariantBase {
|
|
|
2
2
|
fontSize: string;
|
|
3
3
|
lineHeight: string;
|
|
4
4
|
letterSpacing: string;
|
|
5
|
+
fontStyle?: string;
|
|
6
|
+
fontFamily?: string;
|
|
7
|
+
defaultFontWeight?: TypographyFontWeight;
|
|
5
8
|
tag: keyof HTMLElementTagNameMap;
|
|
6
9
|
}
|
|
7
10
|
export type TypographyVariantOptions = Record<PropertyKey, Record<PropertyKey, TypographyVariantBase>>;
|
|
11
|
+
/** @deprecated Weight options are now fixed; this is kept for type compatibility. */
|
|
8
12
|
export type TypographyVariantWeightsOptions = Record<PropertyKey, readonly string[]>;
|
|
9
13
|
export interface TypographyVariantConfig {
|
|
10
14
|
fontFamily: string;
|
|
@@ -91,24 +95,20 @@ export declare const defaultVariantOptions: {
|
|
|
91
95
|
};
|
|
92
96
|
};
|
|
93
97
|
};
|
|
94
|
-
declare const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
readonly title: readonly ["medium", "semi-bold", "bold"];
|
|
98
|
-
readonly body: readonly ["medium", "semi-bold", "bold"];
|
|
99
|
-
};
|
|
100
|
-
type VariantWeights = typeof variantWeights;
|
|
98
|
+
declare const weightOrder: readonly ["", "thin", "extra-light", "light", "normal", "medium", "semi-bold", "bold", "extra-bold", "black"];
|
|
99
|
+
export type TypographyFontWeight = (typeof weightOrder)[number];
|
|
100
|
+
type VariantWeights = typeof weightOrder;
|
|
101
101
|
type WeightSuffix<W> = W extends string ? (W extends '' ? '' : `-${W}`) : '';
|
|
102
|
+
type VariantCategories<Options> = Options;
|
|
102
103
|
export type TypographyVariantFromOptions<Options extends TypographyVariantOptions> = {
|
|
103
|
-
[Category in keyof Options
|
|
104
|
-
[Size in keyof Options[Category]]: `${string & Category}-${string & Size}${WeightSuffix<VariantWeights[
|
|
105
|
-
}[keyof Options[Category]];
|
|
106
|
-
}[keyof Options
|
|
104
|
+
[Category in keyof VariantCategories<Options>]: {
|
|
105
|
+
[Size in keyof VariantCategories<Options>[Category]]: `${string & Category}-${string & Size}${WeightSuffix<VariantWeights[number]>}`;
|
|
106
|
+
}[keyof VariantCategories<Options>[Category]];
|
|
107
|
+
}[keyof VariantCategories<Options>];
|
|
107
108
|
export type TypographyDefaultVariant = TypographyVariantFromOptions<typeof defaultVariantOptions>;
|
|
108
109
|
export type TypographyVariant = TypographyDefaultVariant | (string & {});
|
|
109
110
|
export declare function mergeVariantOptions(variantOptions?: TypographyVariantOptions): TypographyVariantOptions;
|
|
110
|
-
export declare function
|
|
111
|
-
export declare function
|
|
112
|
-
export declare function getVariantTag(variant: TypographyVariant, variantOptions?: TypographyVariantOptions, variantWeightsOptions?: Partial<Record<PropertyKey, readonly string[]>>): keyof HTMLElementTagNameMap;
|
|
111
|
+
export declare function getVariantCssVars(variant: TypographyVariant | undefined, baseVars: Record<string, string>, fontFamilyVariant: string, variantOptions?: TypographyVariantOptions): Record<string, string>;
|
|
112
|
+
export declare function getVariantTag(variant: TypographyVariant, variantOptions?: TypographyVariantOptions): keyof HTMLElementTagNameMap;
|
|
113
113
|
export declare const variantToCssVars: Record<string, TypographyVariantConfig>;
|
|
114
114
|
export {};
|
|
@@ -75,27 +75,42 @@ export const defaultVariantOptions = {
|
|
|
75
75
|
}
|
|
76
76
|
}
|
|
77
77
|
};
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
78
|
+
const weightOrder = [
|
|
79
|
+
'',
|
|
80
|
+
'thin',
|
|
81
|
+
'extra-light',
|
|
82
|
+
'light',
|
|
83
|
+
'normal',
|
|
84
|
+
'medium',
|
|
85
|
+
'semi-bold',
|
|
86
|
+
'bold',
|
|
87
|
+
'extra-bold',
|
|
88
|
+
'black'
|
|
89
|
+
];
|
|
84
90
|
const fontWeights = {
|
|
85
|
-
|
|
86
|
-
'
|
|
87
|
-
|
|
88
|
-
|
|
91
|
+
thin: { weight: '100', style: 'normal' },
|
|
92
|
+
'extra-light': { weight: '200', style: 'normal' },
|
|
93
|
+
light: { weight: '300', style: 'normal' },
|
|
94
|
+
normal: { weight: '400', style: 'normal' },
|
|
95
|
+
medium: { weight: '500', style: 'normal' },
|
|
96
|
+
'semi-bold': { weight: '600', style: 'normal' },
|
|
97
|
+
bold: { weight: '700', style: 'normal' },
|
|
98
|
+
'extra-bold': { weight: '800', style: 'normal' },
|
|
99
|
+
black: { weight: '900', style: 'normal' },
|
|
100
|
+
'': { weight: '700', style: 'normal' }
|
|
89
101
|
};
|
|
90
102
|
function createVariant(options, category, size, weight) {
|
|
91
|
-
var _a, _b, _c;
|
|
103
|
+
var _a, _b, _c, _d, _e, _f;
|
|
92
104
|
const base = (_b = (_a = options === null || options === void 0 ? void 0 : options[category]) === null || _a === void 0 ? void 0 : _a[size]) !== null && _b !== void 0 ? _b : (_c = defaultVariantOptions[category]) === null || _c === void 0 ? void 0 : _c[size];
|
|
93
|
-
const
|
|
105
|
+
const effectiveWeight = weight === '' ? (_d = base === null || base === void 0 ? void 0 : base.defaultFontWeight) !== null && _d !== void 0 ? _d : '' : weight;
|
|
106
|
+
const { weight: fontWeight, style: fontStyle } = fontWeights[effectiveWeight] || fontWeights[''];
|
|
107
|
+
const resolvedFontFamily = (_e = base.fontFamily) !== null && _e !== void 0 ? _e : fontFamily;
|
|
108
|
+
const resolvedFontStyle = (_f = base.fontStyle) !== null && _f !== void 0 ? _f : fontStyle;
|
|
94
109
|
return {
|
|
95
|
-
fontFamily,
|
|
110
|
+
fontFamily: resolvedFontFamily,
|
|
96
111
|
fontSize: base.fontSize,
|
|
97
112
|
fontWeight,
|
|
98
|
-
fontStyle,
|
|
113
|
+
fontStyle: resolvedFontStyle,
|
|
99
114
|
lineHeight: base.lineHeight,
|
|
100
115
|
letterSpacing: base.letterSpacing,
|
|
101
116
|
tag: base.tag
|
|
@@ -115,34 +130,11 @@ export function mergeVariantOptions(variantOptions) {
|
|
|
115
130
|
});
|
|
116
131
|
return mergedOptions;
|
|
117
132
|
}
|
|
118
|
-
|
|
119
|
-
if (!variantWeightsOptions)
|
|
120
|
-
return variantWeights;
|
|
121
|
-
const mergedWeights = {};
|
|
122
|
-
const categories = new Set([
|
|
123
|
-
...Object.keys(variantWeights),
|
|
124
|
-
...Object.keys(variantWeightsOptions)
|
|
125
|
-
]);
|
|
126
|
-
categories.forEach((category) => {
|
|
127
|
-
const defaultWeights = variantWeights[category] || [];
|
|
128
|
-
const customWeights = variantWeightsOptions[category] || [];
|
|
129
|
-
const combined = [...defaultWeights];
|
|
130
|
-
customWeights.forEach((weight) => {
|
|
131
|
-
if (!combined.includes(weight)) {
|
|
132
|
-
combined.push(weight);
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
mergedWeights[category] = combined;
|
|
136
|
-
});
|
|
137
|
-
return mergedWeights;
|
|
138
|
-
}
|
|
139
|
-
function createVariantToCssVars(variantOptions, variantWeightsOptions) {
|
|
133
|
+
function createVariantToCssVars(variantOptions) {
|
|
140
134
|
const configs = {};
|
|
141
|
-
const mergedWeights = mergeVariantWeights(variantWeightsOptions);
|
|
142
135
|
Object.entries(variantOptions).forEach(([category, sizes]) => {
|
|
143
|
-
const weights = mergedWeights[category] || [];
|
|
144
136
|
Object.keys(sizes).forEach((size) => {
|
|
145
|
-
|
|
137
|
+
weightOrder.forEach((weight) => {
|
|
146
138
|
const variantKey = `${category}-${size}${weight ? `-${weight}` : ''}`;
|
|
147
139
|
configs[variantKey] = createVariant(variantOptions, category, size, weight);
|
|
148
140
|
});
|
|
@@ -150,25 +142,25 @@ function createVariantToCssVars(variantOptions, variantWeightsOptions) {
|
|
|
150
142
|
});
|
|
151
143
|
return configs;
|
|
152
144
|
}
|
|
153
|
-
function resolveVariantConfigs(variantOptions
|
|
145
|
+
function resolveVariantConfigs(variantOptions) {
|
|
154
146
|
const hasCustomOptions = variantOptions && Object.keys(variantOptions).length > 0;
|
|
155
|
-
|
|
156
|
-
if (!hasCustomOptions && !hasCustomWeights) {
|
|
147
|
+
if (!hasCustomOptions) {
|
|
157
148
|
return variantToCssVars;
|
|
158
149
|
}
|
|
159
|
-
|
|
150
|
+
const mergedOptions = mergeVariantOptions(variantOptions);
|
|
151
|
+
return createVariantToCssVars(mergedOptions);
|
|
160
152
|
}
|
|
161
|
-
export function getVariantCssVars(variant, baseVars, fontFamilyVariant, variantOptions
|
|
153
|
+
export function getVariantCssVars(variant, baseVars, fontFamilyVariant, variantOptions) {
|
|
162
154
|
const variantStyles = variant
|
|
163
|
-
? resolveVariantConfigs(variantOptions
|
|
155
|
+
? resolveVariantConfigs(variantOptions)[variant]
|
|
164
156
|
: undefined;
|
|
165
157
|
if (!variantStyles) {
|
|
166
158
|
return baseVars;
|
|
167
159
|
}
|
|
168
160
|
return Object.assign(Object.assign({}, baseVars), { '--u-font-famliy-variant': fontFamilyVariant, '--u-variant-font-size': variantStyles.fontSize, '--u-variant-font-weight': variantStyles.fontWeight, '--u-variant-line-height': variantStyles.lineHeight, '--u-variant-font-family': variantStyles.fontFamily, '--u-variant-font-style': variantStyles.fontStyle, '--u-variant-letter-spacing': variantStyles.letterSpacing });
|
|
169
161
|
}
|
|
170
|
-
export function getVariantTag(variant, variantOptions
|
|
162
|
+
export function getVariantTag(variant, variantOptions) {
|
|
171
163
|
var _a;
|
|
172
|
-
return (_a = resolveVariantConfigs(variantOptions
|
|
164
|
+
return (_a = resolveVariantConfigs(variantOptions)[variant]) === null || _a === void 0 ? void 0 : _a.tag;
|
|
173
165
|
}
|
|
174
|
-
export const variantToCssVars = createVariantToCssVars(defaultVariantOptions
|
|
166
|
+
export const variantToCssVars = createVariantToCssVars(defaultVariantOptions);
|
package/es/chat/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { default as UChat } from './src/Chat';
|
|
2
2
|
export { default as UChatListItems } from './src/ChatListItems';
|
|
3
3
|
export { default as UChatMessages } from './src/ChatMessages';
|
|
4
|
-
export type { ChatId, ChatProps, ChatListItemProps, ChatMessageProps, ChatMarkProps, ChatHeaderProps, ChatFooterProps, ChatListHeaderProps, ChatSlots, ChatListItemSlots, ChatMessageSlots, ChatMarkSlots, ChatHeaderSlots, ChatFooterSlots, ChatListItemData, ChatMessageData, ChatAttachment, OnChatSelect, OnMessageSend, OnAttachmentUpload, OnFilterChange, OnNetworkError, OnUploadError, OnSendError, ChatInst, ChatListInst,
|
|
5
|
-
export { MessageStatus, ChatMessageType, ChatMarkType } from './src/interface';
|
|
4
|
+
export type { ChatId, ChatProps, ChatListItemProps, ChatMessageProps, ChatMarkProps, ChatHeaderProps, ChatFooterProps, ChatListHeaderProps, ChatSlots, ChatListItemSlots, ChatMessageSlots, ChatMarkSlots, ChatHeaderSlots, ChatFooterSlots, ChatListItemData, ChatMessageData, ChatAttachment, OnChatSelect, OnMessageSend, OnAttachmentUpload, OnFilterChange, OnNetworkError, OnUploadError, OnSendError, ChatInst, ChatListInst, chatInjectionKey } from './src/interface';
|
|
5
|
+
export { MessageStatus, ChatMessageType, ChatMarkType, ChatAttachmentStatus } from './src/interface';
|
|
6
6
|
export type { ChatListItemsProps } from './src/ChatListItems';
|
|
7
7
|
export type { ChatMessagesProps } from './src/ChatMessages';
|
package/es/chat/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export { default as UChat } from './src/Chat';
|
|
2
2
|
export { default as UChatListItems } from './src/ChatListItems';
|
|
3
3
|
export { default as UChatMessages } from './src/ChatMessages';
|
|
4
|
-
export { MessageStatus, ChatMessageType, ChatMarkType } from './src/interface';
|
|
4
|
+
export { MessageStatus, ChatMessageType, ChatMarkType, ChatAttachmentStatus } from './src/interface';
|
|
@@ -384,7 +384,7 @@ export default defineComponent({
|
|
|
384
384
|
};
|
|
385
385
|
const renderFooter = () => {
|
|
386
386
|
return (h("div", { class: `${mergedClsPrefixRef.value}-chat-main__footer` },
|
|
387
|
-
h(UUpload, Object.assign({ abstract: true, multiple: true, defaultUpload: false, fileList: attachmentFileList.value, onUpdateFileList: handleFileListUpdate }, footerUploadPropsRef.value, { onChange: handleOnChange() }), {
|
|
387
|
+
h(UUpload, Object.assign({ abstract: true, multiple: true, defaultUpload: false, fileList: attachmentFileList.value, onUpdateFileList: !handleOnChange() ? handleFileListUpdate : undefined }, footerUploadPropsRef.value, { onChange: handleOnChange() }), {
|
|
388
388
|
default: () => (h(UFlex, { align: "end", size: "small", wrap: false, class: `${mergedClsPrefixRef.value}-chat-main__input-container` }, {
|
|
389
389
|
default: () => (h(Fragment, null,
|
|
390
390
|
h(UUploadTrigger, { abstract: true }, {
|
package/es/typography/index.d.ts
CHANGED
|
@@ -20,4 +20,8 @@ export type { OlProps } from './src/ol';
|
|
|
20
20
|
export { default as ULi } from './src/li';
|
|
21
21
|
export { default as UText, textProps } from './src/text';
|
|
22
22
|
export type { TextProps } from './src/text';
|
|
23
|
-
export type { TypographyVariant, TypographyVariantOptions,
|
|
23
|
+
export type { TypographyVariant, TypographyVariantOptions,
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated Weight options are fixed; kept for backwards compatibility.
|
|
26
|
+
*/
|
|
27
|
+
TypographyVariantWeightsOptions } from '../_internal/typography';
|
package/es/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "1.12.
|
|
1
|
+
declare const _default: "1.12.7";
|
|
2
2
|
export default _default;
|
package/es/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default '1.12.
|
|
1
|
+
export default '1.12.7';
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
export { default as InternalUText, internalTextProps } from './src/text';
|
|
2
2
|
export type { InternalTextProps } from './src/text';
|
|
3
|
-
export type { TypographyVariant, TypographyVariantOptions,
|
|
3
|
+
export type { TypographyVariant, TypographyVariantOptions,
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Weight options are fixed; override via `variantOptions` instead.
|
|
6
|
+
*/
|
|
7
|
+
TypographyVariantWeightsOptions } from './src/variants';
|
|
@@ -25,6 +25,9 @@ export declare const internalTextProps: {
|
|
|
25
25
|
readonly type: PropType<TypographyVariantOptions>;
|
|
26
26
|
readonly default: () => {};
|
|
27
27
|
};
|
|
28
|
+
/**
|
|
29
|
+
* @deprecated Weight options are fixed internally; kept for backwards compatibility.
|
|
30
|
+
*/
|
|
28
31
|
readonly variantWeightsOptions: {
|
|
29
32
|
readonly type: PropType<TypographyVariantWeightsOptions>;
|
|
30
33
|
readonly default: () => {};
|
|
@@ -114,6 +117,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
114
117
|
readonly type: PropType<TypographyVariantOptions>;
|
|
115
118
|
readonly default: () => {};
|
|
116
119
|
};
|
|
120
|
+
/**
|
|
121
|
+
* @deprecated Weight options are fixed internally; kept for backwards compatibility.
|
|
122
|
+
*/
|
|
117
123
|
readonly variantWeightsOptions: {
|
|
118
124
|
readonly type: PropType<TypographyVariantWeightsOptions>;
|
|
119
125
|
readonly default: () => {};
|
|
@@ -207,6 +213,9 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
207
213
|
readonly type: PropType<TypographyVariantOptions>;
|
|
208
214
|
readonly default: () => {};
|
|
209
215
|
};
|
|
216
|
+
/**
|
|
217
|
+
* @deprecated Weight options are fixed internally; kept for backwards compatibility.
|
|
218
|
+
*/
|
|
210
219
|
readonly variantWeightsOptions: {
|
|
211
220
|
readonly type: PropType<TypographyVariantWeightsOptions>;
|
|
212
221
|
readonly default: () => {};
|
|
@@ -28,7 +28,11 @@ exports.internalTextProps = Object.assign(Object.assign({}, _mixins_1.useTheme.p
|
|
|
28
28
|
}, variantOptions: {
|
|
29
29
|
type: Object,
|
|
30
30
|
default: () => ({})
|
|
31
|
-
},
|
|
31
|
+
},
|
|
32
|
+
/**
|
|
33
|
+
* @deprecated Weight options are fixed internally; kept for backwards compatibility.
|
|
34
|
+
*/
|
|
35
|
+
variantWeightsOptions: {
|
|
32
36
|
type: Object,
|
|
33
37
|
default: () => ({})
|
|
34
38
|
}, strong: Boolean, italic: Boolean, underline: Boolean, strikethrough: Boolean });
|
|
@@ -60,14 +64,13 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
60
64
|
'--u-margin': margin,
|
|
61
65
|
'--u-prefix-color': blockquotePrefixColor
|
|
62
66
|
};
|
|
63
|
-
return (0, variants_1.getVariantCssVars)(variant, baseVars, fontFamilyWixMadeforDisplay, props.variantOptions
|
|
67
|
+
return (0, variants_1.getVariantCssVars)(variant, baseVars, fontFamilyWixMadeforDisplay, props.variantOptions);
|
|
64
68
|
});
|
|
65
69
|
const themeClassHandle = inlineThemeDisabled
|
|
66
70
|
? (0, _mixins_1.useThemeClass)('text', (0, vue_1.computed)(() => `${(props === null || props === void 0 ? void 0 : props.variant) || ''}${(props === null || props === void 0 ? void 0 : props.tag) || ''}`), cssVarsRef, props)
|
|
67
71
|
: undefined;
|
|
68
72
|
const tagToRender = props.tag ||
|
|
69
|
-
(props.variant &&
|
|
70
|
-
(0, variants_1.getVariantTag)(props.variant, props.variantOptions, props.variantWeightsOptions)) ||
|
|
73
|
+
(props.variant && (0, variants_1.getVariantTag)(props.variant, props.variantOptions)) ||
|
|
71
74
|
'span';
|
|
72
75
|
return {
|
|
73
76
|
mergedClsPrefix: mergedClsPrefixRef,
|
|
@@ -2,9 +2,13 @@ export interface TypographyVariantBase {
|
|
|
2
2
|
fontSize: string;
|
|
3
3
|
lineHeight: string;
|
|
4
4
|
letterSpacing: string;
|
|
5
|
+
fontStyle?: string;
|
|
6
|
+
fontFamily?: string;
|
|
7
|
+
defaultFontWeight?: TypographyFontWeight;
|
|
5
8
|
tag: keyof HTMLElementTagNameMap;
|
|
6
9
|
}
|
|
7
10
|
export type TypographyVariantOptions = Record<PropertyKey, Record<PropertyKey, TypographyVariantBase>>;
|
|
11
|
+
/** @deprecated Weight options are now fixed; this is kept for type compatibility. */
|
|
8
12
|
export type TypographyVariantWeightsOptions = Record<PropertyKey, readonly string[]>;
|
|
9
13
|
export interface TypographyVariantConfig {
|
|
10
14
|
fontFamily: string;
|
|
@@ -91,24 +95,20 @@ export declare const defaultVariantOptions: {
|
|
|
91
95
|
};
|
|
92
96
|
};
|
|
93
97
|
};
|
|
94
|
-
declare const
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
readonly title: readonly ["medium", "semi-bold", "bold"];
|
|
98
|
-
readonly body: readonly ["medium", "semi-bold", "bold"];
|
|
99
|
-
};
|
|
100
|
-
type VariantWeights = typeof variantWeights;
|
|
98
|
+
declare const weightOrder: readonly ["", "thin", "extra-light", "light", "normal", "medium", "semi-bold", "bold", "extra-bold", "black"];
|
|
99
|
+
export type TypographyFontWeight = (typeof weightOrder)[number];
|
|
100
|
+
type VariantWeights = typeof weightOrder;
|
|
101
101
|
type WeightSuffix<W> = W extends string ? (W extends '' ? '' : `-${W}`) : '';
|
|
102
|
+
type VariantCategories<Options> = Options;
|
|
102
103
|
export type TypographyVariantFromOptions<Options extends TypographyVariantOptions> = {
|
|
103
|
-
[Category in keyof Options
|
|
104
|
-
[Size in keyof Options[Category]]: `${string & Category}-${string & Size}${WeightSuffix<VariantWeights[
|
|
105
|
-
}[keyof Options[Category]];
|
|
106
|
-
}[keyof Options
|
|
104
|
+
[Category in keyof VariantCategories<Options>]: {
|
|
105
|
+
[Size in keyof VariantCategories<Options>[Category]]: `${string & Category}-${string & Size}${WeightSuffix<VariantWeights[number]>}`;
|
|
106
|
+
}[keyof VariantCategories<Options>[Category]];
|
|
107
|
+
}[keyof VariantCategories<Options>];
|
|
107
108
|
export type TypographyDefaultVariant = TypographyVariantFromOptions<typeof defaultVariantOptions>;
|
|
108
109
|
export type TypographyVariant = TypographyDefaultVariant | (string & {});
|
|
109
110
|
export declare function mergeVariantOptions(variantOptions?: TypographyVariantOptions): TypographyVariantOptions;
|
|
110
|
-
export declare function
|
|
111
|
-
export declare function
|
|
112
|
-
export declare function getVariantTag(variant: TypographyVariant, variantOptions?: TypographyVariantOptions, variantWeightsOptions?: Partial<Record<PropertyKey, readonly string[]>>): keyof HTMLElementTagNameMap;
|
|
111
|
+
export declare function getVariantCssVars(variant: TypographyVariant | undefined, baseVars: Record<string, string>, fontFamilyVariant: string, variantOptions?: TypographyVariantOptions): Record<string, string>;
|
|
112
|
+
export declare function getVariantTag(variant: TypographyVariant, variantOptions?: TypographyVariantOptions): keyof HTMLElementTagNameMap;
|
|
113
113
|
export declare const variantToCssVars: Record<string, TypographyVariantConfig>;
|
|
114
114
|
export {};
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.variantToCssVars = exports.defaultVariantOptions = void 0;
|
|
4
4
|
exports.mergeVariantOptions = mergeVariantOptions;
|
|
5
|
-
exports.mergeVariantWeights = mergeVariantWeights;
|
|
6
5
|
exports.getVariantCssVars = getVariantCssVars;
|
|
7
6
|
exports.getVariantTag = getVariantTag;
|
|
8
7
|
const fontFamily = 'var(--u-font-famliy-variant)';
|
|
@@ -82,27 +81,42 @@ exports.defaultVariantOptions = {
|
|
|
82
81
|
}
|
|
83
82
|
}
|
|
84
83
|
};
|
|
85
|
-
const
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
84
|
+
const weightOrder = [
|
|
85
|
+
'',
|
|
86
|
+
'thin',
|
|
87
|
+
'extra-light',
|
|
88
|
+
'light',
|
|
89
|
+
'normal',
|
|
90
|
+
'medium',
|
|
91
|
+
'semi-bold',
|
|
92
|
+
'bold',
|
|
93
|
+
'extra-bold',
|
|
94
|
+
'black'
|
|
95
|
+
];
|
|
91
96
|
const fontWeights = {
|
|
92
|
-
|
|
93
|
-
'
|
|
94
|
-
|
|
95
|
-
|
|
97
|
+
thin: { weight: '100', style: 'normal' },
|
|
98
|
+
'extra-light': { weight: '200', style: 'normal' },
|
|
99
|
+
light: { weight: '300', style: 'normal' },
|
|
100
|
+
normal: { weight: '400', style: 'normal' },
|
|
101
|
+
medium: { weight: '500', style: 'normal' },
|
|
102
|
+
'semi-bold': { weight: '600', style: 'normal' },
|
|
103
|
+
bold: { weight: '700', style: 'normal' },
|
|
104
|
+
'extra-bold': { weight: '800', style: 'normal' },
|
|
105
|
+
black: { weight: '900', style: 'normal' },
|
|
106
|
+
'': { weight: '700', style: 'normal' }
|
|
96
107
|
};
|
|
97
108
|
function createVariant(options, category, size, weight) {
|
|
98
|
-
var _a, _b, _c;
|
|
109
|
+
var _a, _b, _c, _d, _e, _f;
|
|
99
110
|
const base = (_b = (_a = options === null || options === void 0 ? void 0 : options[category]) === null || _a === void 0 ? void 0 : _a[size]) !== null && _b !== void 0 ? _b : (_c = exports.defaultVariantOptions[category]) === null || _c === void 0 ? void 0 : _c[size];
|
|
100
|
-
const
|
|
111
|
+
const effectiveWeight = weight === '' ? (_d = base === null || base === void 0 ? void 0 : base.defaultFontWeight) !== null && _d !== void 0 ? _d : '' : weight;
|
|
112
|
+
const { weight: fontWeight, style: fontStyle } = fontWeights[effectiveWeight] || fontWeights[''];
|
|
113
|
+
const resolvedFontFamily = (_e = base.fontFamily) !== null && _e !== void 0 ? _e : fontFamily;
|
|
114
|
+
const resolvedFontStyle = (_f = base.fontStyle) !== null && _f !== void 0 ? _f : fontStyle;
|
|
101
115
|
return {
|
|
102
|
-
fontFamily,
|
|
116
|
+
fontFamily: resolvedFontFamily,
|
|
103
117
|
fontSize: base.fontSize,
|
|
104
118
|
fontWeight,
|
|
105
|
-
fontStyle,
|
|
119
|
+
fontStyle: resolvedFontStyle,
|
|
106
120
|
lineHeight: base.lineHeight,
|
|
107
121
|
letterSpacing: base.letterSpacing,
|
|
108
122
|
tag: base.tag
|
|
@@ -122,34 +136,11 @@ function mergeVariantOptions(variantOptions) {
|
|
|
122
136
|
});
|
|
123
137
|
return mergedOptions;
|
|
124
138
|
}
|
|
125
|
-
function
|
|
126
|
-
if (!variantWeightsOptions)
|
|
127
|
-
return variantWeights;
|
|
128
|
-
const mergedWeights = {};
|
|
129
|
-
const categories = new Set([
|
|
130
|
-
...Object.keys(variantWeights),
|
|
131
|
-
...Object.keys(variantWeightsOptions)
|
|
132
|
-
]);
|
|
133
|
-
categories.forEach((category) => {
|
|
134
|
-
const defaultWeights = variantWeights[category] || [];
|
|
135
|
-
const customWeights = variantWeightsOptions[category] || [];
|
|
136
|
-
const combined = [...defaultWeights];
|
|
137
|
-
customWeights.forEach((weight) => {
|
|
138
|
-
if (!combined.includes(weight)) {
|
|
139
|
-
combined.push(weight);
|
|
140
|
-
}
|
|
141
|
-
});
|
|
142
|
-
mergedWeights[category] = combined;
|
|
143
|
-
});
|
|
144
|
-
return mergedWeights;
|
|
145
|
-
}
|
|
146
|
-
function createVariantToCssVars(variantOptions, variantWeightsOptions) {
|
|
139
|
+
function createVariantToCssVars(variantOptions) {
|
|
147
140
|
const configs = {};
|
|
148
|
-
const mergedWeights = mergeVariantWeights(variantWeightsOptions);
|
|
149
141
|
Object.entries(variantOptions).forEach(([category, sizes]) => {
|
|
150
|
-
const weights = mergedWeights[category] || [];
|
|
151
142
|
Object.keys(sizes).forEach((size) => {
|
|
152
|
-
|
|
143
|
+
weightOrder.forEach((weight) => {
|
|
153
144
|
const variantKey = `${category}-${size}${weight ? `-${weight}` : ''}`;
|
|
154
145
|
configs[variantKey] = createVariant(variantOptions, category, size, weight);
|
|
155
146
|
});
|
|
@@ -157,25 +148,25 @@ function createVariantToCssVars(variantOptions, variantWeightsOptions) {
|
|
|
157
148
|
});
|
|
158
149
|
return configs;
|
|
159
150
|
}
|
|
160
|
-
function resolveVariantConfigs(variantOptions
|
|
151
|
+
function resolveVariantConfigs(variantOptions) {
|
|
161
152
|
const hasCustomOptions = variantOptions && Object.keys(variantOptions).length > 0;
|
|
162
|
-
|
|
163
|
-
if (!hasCustomOptions && !hasCustomWeights) {
|
|
153
|
+
if (!hasCustomOptions) {
|
|
164
154
|
return exports.variantToCssVars;
|
|
165
155
|
}
|
|
166
|
-
|
|
156
|
+
const mergedOptions = mergeVariantOptions(variantOptions);
|
|
157
|
+
return createVariantToCssVars(mergedOptions);
|
|
167
158
|
}
|
|
168
|
-
function getVariantCssVars(variant, baseVars, fontFamilyVariant, variantOptions
|
|
159
|
+
function getVariantCssVars(variant, baseVars, fontFamilyVariant, variantOptions) {
|
|
169
160
|
const variantStyles = variant
|
|
170
|
-
? resolveVariantConfigs(variantOptions
|
|
161
|
+
? resolveVariantConfigs(variantOptions)[variant]
|
|
171
162
|
: undefined;
|
|
172
163
|
if (!variantStyles) {
|
|
173
164
|
return baseVars;
|
|
174
165
|
}
|
|
175
166
|
return Object.assign(Object.assign({}, baseVars), { '--u-font-famliy-variant': fontFamilyVariant, '--u-variant-font-size': variantStyles.fontSize, '--u-variant-font-weight': variantStyles.fontWeight, '--u-variant-line-height': variantStyles.lineHeight, '--u-variant-font-family': variantStyles.fontFamily, '--u-variant-font-style': variantStyles.fontStyle, '--u-variant-letter-spacing': variantStyles.letterSpacing });
|
|
176
167
|
}
|
|
177
|
-
function getVariantTag(variant, variantOptions
|
|
168
|
+
function getVariantTag(variant, variantOptions) {
|
|
178
169
|
var _a;
|
|
179
|
-
return (_a = resolveVariantConfigs(variantOptions
|
|
170
|
+
return (_a = resolveVariantConfigs(variantOptions)[variant]) === null || _a === void 0 ? void 0 : _a.tag;
|
|
180
171
|
}
|
|
181
|
-
exports.variantToCssVars = createVariantToCssVars(exports.defaultVariantOptions
|
|
172
|
+
exports.variantToCssVars = createVariantToCssVars(exports.defaultVariantOptions);
|
package/lib/chat/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { default as UChat } from './src/Chat';
|
|
2
2
|
export { default as UChatListItems } from './src/ChatListItems';
|
|
3
3
|
export { default as UChatMessages } from './src/ChatMessages';
|
|
4
|
-
export type { ChatId, ChatProps, ChatListItemProps, ChatMessageProps, ChatMarkProps, ChatHeaderProps, ChatFooterProps, ChatListHeaderProps, ChatSlots, ChatListItemSlots, ChatMessageSlots, ChatMarkSlots, ChatHeaderSlots, ChatFooterSlots, ChatListItemData, ChatMessageData, ChatAttachment, OnChatSelect, OnMessageSend, OnAttachmentUpload, OnFilterChange, OnNetworkError, OnUploadError, OnSendError, ChatInst, ChatListInst,
|
|
5
|
-
export { MessageStatus, ChatMessageType, ChatMarkType } from './src/interface';
|
|
4
|
+
export type { ChatId, ChatProps, ChatListItemProps, ChatMessageProps, ChatMarkProps, ChatHeaderProps, ChatFooterProps, ChatListHeaderProps, ChatSlots, ChatListItemSlots, ChatMessageSlots, ChatMarkSlots, ChatHeaderSlots, ChatFooterSlots, ChatListItemData, ChatMessageData, ChatAttachment, OnChatSelect, OnMessageSend, OnAttachmentUpload, OnFilterChange, OnNetworkError, OnUploadError, OnSendError, ChatInst, ChatListInst, chatInjectionKey } from './src/interface';
|
|
5
|
+
export { MessageStatus, ChatMessageType, ChatMarkType, ChatAttachmentStatus } from './src/interface';
|
|
6
6
|
export type { ChatListItemsProps } from './src/ChatListItems';
|
|
7
7
|
export type { ChatMessagesProps } from './src/ChatMessages';
|
package/lib/chat/index.js
CHANGED
|
@@ -3,7 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.ChatMarkType = exports.ChatMessageType = exports.MessageStatus = exports.UChatMessages = exports.UChatListItems = exports.UChat = void 0;
|
|
6
|
+
exports.ChatAttachmentStatus = exports.ChatMarkType = exports.ChatMessageType = exports.MessageStatus = exports.UChatMessages = exports.UChatListItems = exports.UChat = void 0;
|
|
7
7
|
var Chat_1 = require("./src/Chat");
|
|
8
8
|
Object.defineProperty(exports, "UChat", { enumerable: true, get: function () { return __importDefault(Chat_1).default; } });
|
|
9
9
|
var ChatListItems_1 = require("./src/ChatListItems");
|
|
@@ -14,3 +14,4 @@ var interface_1 = require("./src/interface");
|
|
|
14
14
|
Object.defineProperty(exports, "MessageStatus", { enumerable: true, get: function () { return interface_1.MessageStatus; } });
|
|
15
15
|
Object.defineProperty(exports, "ChatMessageType", { enumerable: true, get: function () { return interface_1.ChatMessageType; } });
|
|
16
16
|
Object.defineProperty(exports, "ChatMarkType", { enumerable: true, get: function () { return interface_1.ChatMarkType; } });
|
|
17
|
+
Object.defineProperty(exports, "ChatAttachmentStatus", { enumerable: true, get: function () { return interface_1.ChatAttachmentStatus; } });
|
|
@@ -389,7 +389,7 @@ exports.default = (0, vue_1.defineComponent)({
|
|
|
389
389
|
};
|
|
390
390
|
const renderFooter = () => {
|
|
391
391
|
return ((0, vue_1.h)("div", { class: `${mergedClsPrefixRef.value}-chat-main__footer` },
|
|
392
|
-
(0, vue_1.h)(upload_1.UUpload, Object.assign({ abstract: true, multiple: true, defaultUpload: false, fileList: attachmentFileList.value, onUpdateFileList: handleFileListUpdate }, footerUploadPropsRef.value, { onChange: handleOnChange() }), {
|
|
392
|
+
(0, vue_1.h)(upload_1.UUpload, Object.assign({ abstract: true, multiple: true, defaultUpload: false, fileList: attachmentFileList.value, onUpdateFileList: !handleOnChange() ? handleFileListUpdate : undefined }, footerUploadPropsRef.value, { onChange: handleOnChange() }), {
|
|
393
393
|
default: () => ((0, vue_1.h)(flex_1.UFlex, { align: "end", size: "small", wrap: false, class: `${mergedClsPrefixRef.value}-chat-main__input-container` }, {
|
|
394
394
|
default: () => ((0, vue_1.h)(vue_1.Fragment, null,
|
|
395
395
|
(0, vue_1.h)(upload_1.UUploadTrigger, { abstract: true }, {
|
|
@@ -20,4 +20,8 @@ export type { OlProps } from './src/ol';
|
|
|
20
20
|
export { default as ULi } from './src/li';
|
|
21
21
|
export { default as UText, textProps } from './src/text';
|
|
22
22
|
export type { TextProps } from './src/text';
|
|
23
|
-
export type { TypographyVariant, TypographyVariantOptions,
|
|
23
|
+
export type { TypographyVariant, TypographyVariantOptions,
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated Weight options are fixed; kept for backwards compatibility.
|
|
26
|
+
*/
|
|
27
|
+
TypographyVariantWeightsOptions } from '../_internal/typography';
|
package/lib/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "1.12.
|
|
1
|
+
declare const _default: "1.12.7";
|
|
2
2
|
export default _default;
|
package/lib/version.js
CHANGED