@omnia/velcron 8.0.322-dev → 8.0.324-dev
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/formatters/CapitalizeFormatter.d.ts +2 -0
- package/formatters/CapitalizeFormatter.js +14 -0
- package/formatters/DateFormatter.d.ts +2 -0
- package/formatters/DateFormatter.js +19 -0
- package/formatters/InterpolationFormatter.d.ts +4 -0
- package/formatters/JsonFormatter.d.ts +2 -0
- package/formatters/JsonFormatter.js +11 -0
- package/formatters/LengthFormatter.d.ts +2 -0
- package/formatters/LengthFormatter.js +14 -0
- package/formatters/ReplaceFormatter.d.ts +2 -0
- package/formatters/ReplaceFormatter.js +14 -0
- package/formatters/SubStringFormatter.d.ts +2 -0
- package/formatters/SubStringFormatter.js +14 -0
- package/formatters/TrimFormatter.d.ts +2 -0
- package/formatters/TrimFormatter.js +17 -0
- package/formatters/UppercaseFormatter.d.ts +2 -0
- package/formatters/UppercaseFormatter.js +14 -0
- package/formatters/index.d.ts +9 -0
- package/formatters/index.js +12 -0
- package/index.d.ts +1 -0
- package/index.js +1 -0
- package/internal-do-not-import-from-here/shared/models/OmniaHub.d.ts +5 -0
- package/internal-do-not-import-from-here/shared/models/{hub/activities/ActivityHubServiceId.js → OmniaHub.js} +3 -1
- package/internal-do-not-import-from-here/shared/models/OmniaSharedBootstrapData.d.ts +1 -1
- package/internal-do-not-import-from-here/shared/models/Realtime.d.ts +0 -15
- package/internal-do-not-import-from-here/shared/models/Realtime.js +0 -17
- package/internal-do-not-import-from-here/shared/models/index.d.ts +1 -1
- package/internal-do-not-import-from-here/shared/models/index.js +1 -1
- package/internal-do-not-import-from-here/shared/models/theme/Blueprints.d.ts +9 -8
- package/internal-do-not-import-from-here/shared/models/theme/SharedBlueprintMethods.d.ts +3 -1
- package/internal-do-not-import-from-here/shared/models/theme/SharedBlueprintMethods.js +38 -34
- package/internal-do-not-import-from-here/shared/models/theme/ThemeDefinition.d.ts +4 -3
- package/internal-do-not-import-from-here/shared/models/theme/Typography.d.ts +1 -2
- package/package.json +1 -1
- package/parser/VelcronDataBinder.d.ts +50 -0
- package/parser/VelcronDataBinder.js +132 -22
- package/parser/VelcronFormatters.d.ts +6 -0
- package/parser/VelcronFormatters.js +20 -0
- package/parser/VelcronStyles.js +19 -19
- package/parser/index.d.ts +1 -0
- package/parser/index.js +1 -0
- package/stores/VelcronTheming.js +2 -2
- package/internal-do-not-import-from-here/shared/models/hub/TempSocialReactions.d.ts +0 -13
- package/internal-do-not-import-from-here/shared/models/hub/TempSocialReactions.js +0 -20
- package/internal-do-not-import-from-here/shared/models/hub/activities/Activity.d.ts +0 -75
- package/internal-do-not-import-from-here/shared/models/hub/activities/Activity.js +0 -13
- package/internal-do-not-import-from-here/shared/models/hub/activities/ActivityChannel.d.ts +0 -7
- package/internal-do-not-import-from-here/shared/models/hub/activities/ActivityChannel.js +0 -4
- package/internal-do-not-import-from-here/shared/models/hub/activities/ActivityDefinition.d.ts +0 -14
- package/internal-do-not-import-from-here/shared/models/hub/activities/ActivityDefinition.js +0 -15
- package/internal-do-not-import-from-here/shared/models/hub/activities/ActivityFeed.d.ts +0 -31
- package/internal-do-not-import-from-here/shared/models/hub/activities/ActivityHubServiceId.d.ts +0 -2
- package/internal-do-not-import-from-here/shared/models/hub/activities/ActivityRenderer.d.ts +0 -15
- package/internal-do-not-import-from-here/shared/models/hub/activities/ActivityRenderer.js +0 -4
- package/internal-do-not-import-from-here/shared/models/hub/activities/ActivityRendererLoadingReferences.d.ts +0 -8
- package/internal-do-not-import-from-here/shared/models/hub/activities/ActivityRendererLoadingReferences.js +0 -2
- package/internal-do-not-import-from-here/shared/models/hub/activities/ActivitySubscription.d.ts +0 -16
- package/internal-do-not-import-from-here/shared/models/hub/activities/ActivitySubscription.js +0 -4
- package/internal-do-not-import-from-here/shared/models/hub/activities/ActorActivity.d.ts +0 -48
- package/internal-do-not-import-from-here/shared/models/hub/activities/ActorActivity.js +0 -17
- package/internal-do-not-import-from-here/shared/models/hub/activities/index.d.ts +0 -9
- package/internal-do-not-import-from-here/shared/models/hub/activities/index.js +0 -12
- package/internal-do-not-import-from-here/shared/models/hub/actors/Actor.d.ts +0 -21
- package/internal-do-not-import-from-here/shared/models/hub/actors/Actor.js +0 -10
- package/internal-do-not-import-from-here/shared/models/hub/actors/ExternalActorId.d.ts +0 -2
- package/internal-do-not-import-from-here/shared/models/hub/actors/ExternalActorId.js +0 -2
- package/internal-do-not-import-from-here/shared/models/hub/actors/index.d.ts +0 -2
- package/internal-do-not-import-from-here/shared/models/hub/actors/index.js +0 -5
- package/internal-do-not-import-from-here/shared/models/hub/fileupload/FileOwnerId.d.ts +0 -3
- package/internal-do-not-import-from-here/shared/models/hub/fileupload/FileOwnerId.js +0 -4
- package/internal-do-not-import-from-here/shared/models/hub/fileupload/TemporaryFileId.d.ts +0 -4
- package/internal-do-not-import-from-here/shared/models/hub/fileupload/TemporaryFileId.js +0 -4
- package/internal-do-not-import-from-here/shared/models/hub/fileupload/index.d.ts +0 -2
- package/internal-do-not-import-from-here/shared/models/hub/fileupload/index.js +0 -5
- package/internal-do-not-import-from-here/shared/models/hub/index.d.ts +0 -7
- package/internal-do-not-import-from-here/shared/models/hub/index.js +0 -10
- package/internal-do-not-import-from-here/shared/models/hub/social/HubComment.d.ts +0 -10
- package/internal-do-not-import-from-here/shared/models/hub/social/HubComment.js +0 -2
- package/internal-do-not-import-from-here/shared/models/hub/social/HubReaction.d.ts +0 -5
- package/internal-do-not-import-from-here/shared/models/hub/social/HubReaction.js +0 -2
- package/internal-do-not-import-from-here/shared/models/hub/social/index.d.ts +0 -2
- package/internal-do-not-import-from-here/shared/models/hub/social/index.js +0 -5
- package/internal-do-not-import-from-here/shared/models/hub/targeting/ExternalIdentityProperty.d.ts +0 -10
- package/internal-do-not-import-from-here/shared/models/hub/targeting/ExternalIdentityProperty.js +0 -19
- package/internal-do-not-import-from-here/shared/models/hub/targeting/HubSource.d.ts +0 -4
- package/internal-do-not-import-from-here/shared/models/hub/targeting/HubSource.js +0 -8
- package/internal-do-not-import-from-here/shared/models/hub/targeting/index.d.ts +0 -1
- package/internal-do-not-import-from-here/shared/models/hub/targeting/index.js +0 -4
- /package/{internal-do-not-import-from-here/shared/models/hub/activities/ActivityFeed.js → formatters/InterpolationFormatter.js} +0 -0
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.capitalizeFormatter = void 0;
|
|
4
|
+
const parser_1 = require("../parser");
|
|
5
|
+
exports.capitalizeFormatter = {
|
|
6
|
+
name: "capitalize",
|
|
7
|
+
format: (value) => {
|
|
8
|
+
if (typeof value === "string") {
|
|
9
|
+
return value.replace(/\b\w/g, (char) => char.toUpperCase());
|
|
10
|
+
}
|
|
11
|
+
return value;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
parser_1.VelcronFormatters.registerFormatter(exports.capitalizeFormatter);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.dateFormatter = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const dayjs_1 = tslib_1.__importDefault(require("dayjs"));
|
|
6
|
+
const parser_1 = require("../parser");
|
|
7
|
+
exports.dateFormatter = {
|
|
8
|
+
name: "date",
|
|
9
|
+
format: (value, formatStr = "YYYY-MM-DD") => {
|
|
10
|
+
if (typeof value === "string" || value instanceof Date) {
|
|
11
|
+
const date = (0, dayjs_1.default)(value);
|
|
12
|
+
if (date.isValid()) {
|
|
13
|
+
return date.format(formatStr);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return value;
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
parser_1.VelcronFormatters.registerFormatter(exports.dateFormatter);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.jsonFormatter = void 0;
|
|
4
|
+
const parser_1 = require("../parser");
|
|
5
|
+
exports.jsonFormatter = {
|
|
6
|
+
name: "json",
|
|
7
|
+
format: (value) => {
|
|
8
|
+
return JSON.stringify(value, null, 2);
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
parser_1.VelcronFormatters.registerFormatter(exports.jsonFormatter);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.lengthFormatter = void 0;
|
|
4
|
+
const parser_1 = require("../parser");
|
|
5
|
+
exports.lengthFormatter = {
|
|
6
|
+
name: "length",
|
|
7
|
+
format: (value) => {
|
|
8
|
+
if (typeof value === "string" || Array.isArray(value)) {
|
|
9
|
+
return value.length;
|
|
10
|
+
}
|
|
11
|
+
return 0;
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
parser_1.VelcronFormatters.registerFormatter(exports.lengthFormatter);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.replaceFormatter = void 0;
|
|
4
|
+
const parser_1 = require("../parser");
|
|
5
|
+
exports.replaceFormatter = {
|
|
6
|
+
name: "replace",
|
|
7
|
+
format: (value, search, replacement) => {
|
|
8
|
+
if (typeof value === "string") {
|
|
9
|
+
return value.split(search).join(replacement);
|
|
10
|
+
}
|
|
11
|
+
return value;
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
parser_1.VelcronFormatters.registerFormatter(exports.replaceFormatter);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.substringFormatter = void 0;
|
|
4
|
+
const parser_1 = require("../parser");
|
|
5
|
+
exports.substringFormatter = {
|
|
6
|
+
name: "substring",
|
|
7
|
+
format: (value, start, end) => {
|
|
8
|
+
if (typeof value === "string") {
|
|
9
|
+
return value.substring(start, end);
|
|
10
|
+
}
|
|
11
|
+
return value;
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
parser_1.VelcronFormatters.registerFormatter(exports.substringFormatter);
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.trimFormatter = void 0;
|
|
4
|
+
const parser_1 = require("../parser");
|
|
5
|
+
exports.trimFormatter = {
|
|
6
|
+
name: "trim",
|
|
7
|
+
format: (value, lengthStr = "100") => {
|
|
8
|
+
if (typeof value === "string") {
|
|
9
|
+
const maxLength = parseInt(lengthStr, 10);
|
|
10
|
+
if (isNaN(maxLength))
|
|
11
|
+
return value;
|
|
12
|
+
return value.length > maxLength ? value.substring(0, maxLength) + "..." : value;
|
|
13
|
+
}
|
|
14
|
+
return value;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
parser_1.VelcronFormatters.registerFormatter(exports.trimFormatter);
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.uppercaseFormatter = void 0;
|
|
4
|
+
const parser_1 = require("../parser");
|
|
5
|
+
exports.uppercaseFormatter = {
|
|
6
|
+
name: "uppercase",
|
|
7
|
+
format: (value) => {
|
|
8
|
+
if (typeof value === "string") {
|
|
9
|
+
return value.toUpperCase();
|
|
10
|
+
}
|
|
11
|
+
return value;
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
parser_1.VelcronFormatters.registerFormatter(exports.uppercaseFormatter);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from "./InterpolationFormatter";
|
|
2
|
+
export * from "./DateFormatter";
|
|
3
|
+
export * from "./CapitalizeFormatter";
|
|
4
|
+
export * from "./UppercaseFormatter";
|
|
5
|
+
export * from "./TrimFormatter";
|
|
6
|
+
export * from "./JsonFormatter";
|
|
7
|
+
export * from "./LengthFormatter";
|
|
8
|
+
export * from "./ReplaceFormatter";
|
|
9
|
+
export * from "./SubStringFormatter";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./InterpolationFormatter"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./DateFormatter"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./CapitalizeFormatter"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./UppercaseFormatter"), exports);
|
|
8
|
+
tslib_1.__exportStar(require("./TrimFormatter"), exports);
|
|
9
|
+
tslib_1.__exportStar(require("./JsonFormatter"), exports);
|
|
10
|
+
tslib_1.__exportStar(require("./LengthFormatter"), exports);
|
|
11
|
+
tslib_1.__exportStar(require("./ReplaceFormatter"), exports);
|
|
12
|
+
tslib_1.__exportStar(require("./SubStringFormatter"), exports);
|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -10,3 +10,4 @@ tslib_1.__exportStar(require("./rules"), exports);
|
|
|
10
10
|
tslib_1.__exportStar(require("./templatebuilder"), exports);
|
|
11
11
|
tslib_1.__exportStar(require("./events"), exports);
|
|
12
12
|
tslib_1.__exportStar(require("./providers"), exports);
|
|
13
|
+
tslib_1.__exportStar(require("./formatters"), exports);
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ActivityHubServiceId = void 0;
|
|
4
|
-
|
|
4
|
+
exports.ActorId = ActorId;
|
|
5
|
+
const Guid_1 = require("./Guid");
|
|
6
|
+
function ActorId(id) { return id; }
|
|
5
7
|
exports.ActivityHubServiceId = (0, Guid_1.guid)("92fab26a-90c4-45e2-9b5e-9bdf0e26ea14");
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { OmniaToken } from "./Tokens";
|
|
2
2
|
import { guid } from "./Guid";
|
|
3
3
|
import { TenantIdentifier } from "./Tenant";
|
|
4
|
-
import { ActorId } from "./
|
|
4
|
+
import { ActorId } from "./OmniaHub";
|
|
5
5
|
export interface OmniaSharedBootstrapData {
|
|
6
6
|
uiThreadId: guid;
|
|
7
7
|
workerThreadId: guid;
|
|
@@ -1,19 +1,4 @@
|
|
|
1
1
|
import { guid } from "./Guid";
|
|
2
|
-
export declare abstract class RealtimeChannel {
|
|
3
|
-
/**
|
|
4
|
-
* Construct a unique channel id that can be targeted to users who are set to be in that channel on the client
|
|
5
|
-
* @returns id
|
|
6
|
-
*/
|
|
7
|
-
abstract getId(): string;
|
|
8
|
-
}
|
|
9
|
-
export declare abstract class RealtimeData<TRealtimeChannel extends RealtimeChannel, TRealtimeData> {
|
|
10
|
-
private _channel;
|
|
11
|
-
private _value;
|
|
12
|
-
get channel(): TRealtimeChannel;
|
|
13
|
-
get value(): TRealtimeData;
|
|
14
|
-
abstract getId(): guid;
|
|
15
|
-
constructor(channel: TRealtimeChannel, value?: TRealtimeData);
|
|
16
|
-
}
|
|
17
2
|
export type RealtimeChannelUpdateTypes = "activate" | "deactivate";
|
|
18
3
|
export interface RealtimeChannelUpdateMessage extends RealtimChannelMessage {
|
|
19
4
|
threadId: guid;
|
|
@@ -1,19 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RealtimeData = exports.RealtimeChannel = void 0;
|
|
4
|
-
class RealtimeChannel {
|
|
5
|
-
}
|
|
6
|
-
exports.RealtimeChannel = RealtimeChannel;
|
|
7
|
-
class RealtimeData {
|
|
8
|
-
get channel() {
|
|
9
|
-
return this._channel;
|
|
10
|
-
}
|
|
11
|
-
get value() {
|
|
12
|
-
return this._value;
|
|
13
|
-
}
|
|
14
|
-
constructor(channel, value) {
|
|
15
|
-
this._channel = channel;
|
|
16
|
-
this._value = value;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
exports.RealtimeData = RealtimeData;
|
|
@@ -15,9 +15,9 @@ export * from "./StringExtensions";
|
|
|
15
15
|
export * from "./DynamicState";
|
|
16
16
|
export * from "./Id";
|
|
17
17
|
export * from "./theme";
|
|
18
|
-
export * from "./hub";
|
|
19
18
|
export * from "./velcron";
|
|
20
19
|
export * from "./DependencyInjection";
|
|
21
20
|
export * from "./Messaging";
|
|
22
21
|
export * from "./EventHook";
|
|
23
22
|
export * from "./ShortId";
|
|
23
|
+
export * from "./OmniaHub";
|
|
@@ -19,9 +19,9 @@ tslib_1.__exportStar(require("./StringExtensions"), exports);
|
|
|
19
19
|
tslib_1.__exportStar(require("./DynamicState"), exports);
|
|
20
20
|
tslib_1.__exportStar(require("./Id"), exports);
|
|
21
21
|
tslib_1.__exportStar(require("./theme"), exports);
|
|
22
|
-
tslib_1.__exportStar(require("./hub"), exports);
|
|
23
22
|
tslib_1.__exportStar(require("./velcron"), exports);
|
|
24
23
|
tslib_1.__exportStar(require("./DependencyInjection"), exports);
|
|
25
24
|
tslib_1.__exportStar(require("./Messaging"), exports);
|
|
26
25
|
tslib_1.__exportStar(require("./EventHook"), exports);
|
|
27
26
|
tslib_1.__exportStar(require("./ShortId"), exports);
|
|
27
|
+
tslib_1.__exportStar(require("./OmniaHub"), exports);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { BackgroundDefinition, BlueprintsReference, ColorValue, FillDefinitionValue } from "./ThemeDefinition";
|
|
2
2
|
import { SpacingDefinition, Spacing } from "./Spacing";
|
|
3
3
|
import { TypographyFontDefinition, TypographyValue } from "./Typography";
|
|
4
|
-
import { TypographyBlueprint } from "./Typography";
|
|
5
4
|
import { ThemeBase } from "./ThemeBase";
|
|
6
5
|
import { VelcronRendererResolverReference } from "../velcron";
|
|
7
6
|
export interface BlueprintStrategy {
|
|
@@ -43,15 +42,9 @@ export interface ContainerFillBlueprint extends Blueprints, BlueprintsReference
|
|
|
43
42
|
name?: string;
|
|
44
43
|
background?: BackgroundDefinition;
|
|
45
44
|
}
|
|
46
|
-
export interface TypographyBlueprints extends ThemeBase {
|
|
47
|
-
primary: TypographyBlueprint;
|
|
48
|
-
}
|
|
49
45
|
export interface IFontBlueprints extends Blueprints, BlueprintsReference {
|
|
50
46
|
fonts: Array<TypographyFontDefinition>;
|
|
51
47
|
}
|
|
52
|
-
export interface SpacingBlueprints extends ThemeBase {
|
|
53
|
-
primary: SpacingBlueprint;
|
|
54
|
-
}
|
|
55
48
|
export interface ComponentBlueprints extends ThemeBase {
|
|
56
49
|
strategy?: "MD2" | "MD3";
|
|
57
50
|
buttons?: ButtonBlueprints;
|
|
@@ -60,8 +53,9 @@ export interface ComponentBlueprints extends ThemeBase {
|
|
|
60
53
|
chips?: ChipBlueprint;
|
|
61
54
|
fills?: ContainerFillBlueprints;
|
|
62
55
|
headers?: HeaderBlueprints;
|
|
56
|
+
inputs?: InputBlueprints;
|
|
63
57
|
}
|
|
64
|
-
export interface SpacingBlueprint {
|
|
58
|
+
export interface SpacingBlueprint extends ThemeBase {
|
|
65
59
|
l?: SpacingDefinition;
|
|
66
60
|
s?: SpacingDefinition;
|
|
67
61
|
}
|
|
@@ -120,6 +114,13 @@ export interface ButtonBlueprints extends Blueprints {
|
|
|
120
114
|
close?: ButtonBlueprint;
|
|
121
115
|
} & VariantBlueprints<ButtonBlueprint>;
|
|
122
116
|
}
|
|
117
|
+
export interface InputBlueprints extends Blueprints, VariantBlueprints<InputBlueprint> {
|
|
118
|
+
primary?: InputBlueprint;
|
|
119
|
+
}
|
|
120
|
+
export interface InputBlueprint extends Blueprint {
|
|
121
|
+
variant: "filled" | "underlined" | "outlined" | "plain" | "solo" | "solo-inverted" | "solo-filled";
|
|
122
|
+
density?: "large" | "comfortable" | "compact";
|
|
123
|
+
}
|
|
123
124
|
export interface TabsBlueprints extends Blueprints, VariantBlueprints<TabsBlueprint> {
|
|
124
125
|
primary?: TabsBlueprint;
|
|
125
126
|
}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { SpacingBlueprint } from "./Blueprints";
|
|
2
2
|
import { SpacingScale } from "./Spacing";
|
|
3
|
-
export declare
|
|
3
|
+
export declare namespace SpacingMethods {
|
|
4
|
+
function getSpacingValueFromBlueprint(spacingValue: any, blueprint: SpacingBlueprint, scale?: SpacingScale): number;
|
|
5
|
+
}
|
|
@@ -1,44 +1,48 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
// import { SpacingDefinition, SpacingTypes } from "@omnia/fx-models";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.SpacingMethods = void 0;
|
|
5
5
|
const Spacing_1 = require("./Spacing");
|
|
6
6
|
const useSpacingScaling_1 = require("./useSpacingScaling");
|
|
7
7
|
const spacingScaling = (0, useSpacingScaling_1.useSpacingScaling)();
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
scale = spacingScaling.get.scale(spacingValue);
|
|
14
|
-
}
|
|
15
|
-
const definition = scale === "l" ? blueprint.l : blueprint.s;
|
|
16
|
-
let negative = false;
|
|
17
|
-
let result = spacingValue;
|
|
18
|
-
if (isNaN(spacingValue)) {
|
|
19
|
-
let strippedValue = spacingScaling.get.valueWithoutScale(spacingValue);
|
|
20
|
-
if (strippedValue.startsWith("-")) {
|
|
21
|
-
negative = true;
|
|
22
|
-
}
|
|
23
|
-
strippedValue = strippedValue.replace("-", "");
|
|
24
|
-
if (strippedValue === Spacing_1.SpacingTypes.xs) {
|
|
25
|
-
result = definition.xs;
|
|
26
|
-
}
|
|
27
|
-
else if (strippedValue === Spacing_1.SpacingTypes.s) {
|
|
28
|
-
result = definition.s;
|
|
29
|
-
}
|
|
30
|
-
else if (strippedValue === Spacing_1.SpacingTypes.m) {
|
|
31
|
-
result = definition.m;
|
|
32
|
-
}
|
|
33
|
-
else if (strippedValue === Spacing_1.SpacingTypes.l) {
|
|
34
|
-
result = definition.l;
|
|
8
|
+
var SpacingMethods;
|
|
9
|
+
(function (SpacingMethods) {
|
|
10
|
+
function getSpacingValueFromBlueprint(spacingValue, blueprint, scale) {
|
|
11
|
+
if (!spacingValue) {
|
|
12
|
+
return 0;
|
|
35
13
|
}
|
|
36
|
-
|
|
37
|
-
|
|
14
|
+
if (!scale) {
|
|
15
|
+
scale = spacingScaling.get.scale(spacingValue);
|
|
38
16
|
}
|
|
39
|
-
|
|
40
|
-
|
|
17
|
+
const definition = scale === "l" ? blueprint.l : blueprint.s;
|
|
18
|
+
let negative = false;
|
|
19
|
+
let result = spacingValue;
|
|
20
|
+
if (isNaN(spacingValue)) {
|
|
21
|
+
let strippedValue = spacingScaling.get.valueWithoutScale(spacingValue);
|
|
22
|
+
if (strippedValue.startsWith("-")) {
|
|
23
|
+
negative = true;
|
|
24
|
+
}
|
|
25
|
+
strippedValue = strippedValue.replace("-", "");
|
|
26
|
+
if (strippedValue === Spacing_1.SpacingTypes.xs) {
|
|
27
|
+
result = definition.xs;
|
|
28
|
+
}
|
|
29
|
+
else if (strippedValue === Spacing_1.SpacingTypes.s) {
|
|
30
|
+
result = definition.s;
|
|
31
|
+
}
|
|
32
|
+
else if (strippedValue === Spacing_1.SpacingTypes.m) {
|
|
33
|
+
result = definition.m;
|
|
34
|
+
}
|
|
35
|
+
else if (strippedValue === Spacing_1.SpacingTypes.l) {
|
|
36
|
+
result = definition.l;
|
|
37
|
+
}
|
|
38
|
+
else if (strippedValue === Spacing_1.SpacingTypes.xl) {
|
|
39
|
+
result = definition.xl;
|
|
40
|
+
}
|
|
41
|
+
else {
|
|
42
|
+
result = 0;
|
|
43
|
+
}
|
|
41
44
|
}
|
|
45
|
+
return negative ? -result : result;
|
|
42
46
|
}
|
|
43
|
-
|
|
44
|
-
}
|
|
47
|
+
SpacingMethods.getSpacingValueFromBlueprint = getSpacingValueFromBlueprint;
|
|
48
|
+
})(SpacingMethods || (exports.SpacingMethods = SpacingMethods = {}));
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { guid } from "../Guid";
|
|
2
2
|
import { Id } from "../Id";
|
|
3
|
-
import { BlueprintVariant, BoxDimensions, ButtonBlueprint, ComponentBlueprints,
|
|
3
|
+
import { BlueprintVariant, BoxDimensions, ButtonBlueprint, ComponentBlueprints, SpacingBlueprint } from "./Blueprints";
|
|
4
4
|
import { Color } from "./Color";
|
|
5
5
|
import { LegacyBorderDefinition, LegacyThemeDefinition } from "./LegacyThemeDefinition";
|
|
6
6
|
import { ThemeBase } from "./ThemeBase";
|
|
7
|
+
import { TypographyBlueprint } from "./Typography";
|
|
7
8
|
export type ThemeContextType = "default" | "admin" | "preview" | "color-context" | "designer";
|
|
8
9
|
export interface ColorTypeResult<resultType> {
|
|
9
10
|
base: resultType;
|
|
@@ -73,8 +74,8 @@ export interface ThemeDefinitionReference {
|
|
|
73
74
|
}
|
|
74
75
|
export interface ResolvedThemeDefinition extends ThemeBase {
|
|
75
76
|
colors?: ColorSchemas;
|
|
76
|
-
typography?:
|
|
77
|
-
spacing?:
|
|
77
|
+
typography?: TypographyBlueprint;
|
|
78
|
+
spacing?: SpacingBlueprint;
|
|
78
79
|
components?: ComponentBlueprints;
|
|
79
80
|
}
|
|
80
81
|
export interface ThemeSelection {
|
|
@@ -7,8 +7,7 @@ export interface TypographyFontDefinition extends ThemeBase {
|
|
|
7
7
|
cdn?: string;
|
|
8
8
|
manifestId?: guid;
|
|
9
9
|
}
|
|
10
|
-
export interface TypographyBlueprint {
|
|
11
|
-
name: string;
|
|
10
|
+
export interface TypographyBlueprint extends ThemeBase {
|
|
12
11
|
font?: TypographyFontRef;
|
|
13
12
|
fills?: VariantBlueprints<FillDefinition>;
|
|
14
13
|
variants?: VariantBlueprints<TypographyDefinition>;
|
package/package.json
CHANGED
|
@@ -1,12 +1,62 @@
|
|
|
1
1
|
import { VelcronRenderContext } from "../models";
|
|
2
2
|
import { VelcronBindableProp } from "..";
|
|
3
3
|
export declare class VelcronDataBinder {
|
|
4
|
+
/**
|
|
5
|
+
* Binds a value based on the provided binding expression.
|
|
6
|
+
* @param renderContext The render context containing state and other data.
|
|
7
|
+
* @param bindTo The binding expression or value.
|
|
8
|
+
* @returns The bound value after applying formatters and other logic.
|
|
9
|
+
*/
|
|
4
10
|
static bind<T = string>(renderContext: VelcronRenderContext, bindTo: VelcronBindableProp<any>): T;
|
|
11
|
+
/**
|
|
12
|
+
* Interpolates tokens within a binding string and applies formatters.
|
|
13
|
+
* @param bindTo The binding string containing tokens.
|
|
14
|
+
* @param renderContext The render context.
|
|
15
|
+
* @returns The interpolated string with formatters applied.
|
|
16
|
+
*/
|
|
5
17
|
private static interpolateTokens;
|
|
18
|
+
/**
|
|
19
|
+
* Parses an interpolation string to extract the variable and its formatters.
|
|
20
|
+
* @param match The interpolation string, e.g., "{{ variable | formatter1:'arg1','arg2' | formatter2 }}"
|
|
21
|
+
* @returns An Interpolation object or null if parsing fails.
|
|
22
|
+
*/
|
|
23
|
+
private static parseInterpolation;
|
|
24
|
+
/**
|
|
25
|
+
* Processes a token that might represent an action or a state variable.
|
|
26
|
+
* @param tokenWithoutBrackets The token string without the surrounding {{ }}.
|
|
27
|
+
* @param renderContext The render context.
|
|
28
|
+
* @returns The result of processing the token.
|
|
29
|
+
*/
|
|
6
30
|
private static processToken;
|
|
31
|
+
/**
|
|
32
|
+
* Evaluates a switch expression based on the render context.
|
|
33
|
+
* @param expression The switch expression object.
|
|
34
|
+
* @param renderContext The render context.
|
|
35
|
+
* @returns The result of the switch expression.
|
|
36
|
+
*/
|
|
7
37
|
private static evaluateSwitchExpression;
|
|
38
|
+
/**
|
|
39
|
+
* Recursively evaluates an expression which can be a string, object, or other types.
|
|
40
|
+
* @param expr The expression to evaluate.
|
|
41
|
+
* @param renderContext The render context.
|
|
42
|
+
* @returns The evaluated result.
|
|
43
|
+
*/
|
|
8
44
|
private static evaluateExpression;
|
|
45
|
+
/**
|
|
46
|
+
* Attempts to update a bound value in the render context.
|
|
47
|
+
* @param renderContext The render context.
|
|
48
|
+
* @param bindPath The binding path string.
|
|
49
|
+
* @param value The new value to set.
|
|
50
|
+
*/
|
|
9
51
|
static tryUpdateBoundValue(renderContext: VelcronRenderContext, bindPath: string, value: unknown): void;
|
|
52
|
+
/**
|
|
53
|
+
* Binds multiple properties at once based on the provided definitions.
|
|
54
|
+
* @param renderContext The render context.
|
|
55
|
+
* @param definition The binding definitions for each property.
|
|
56
|
+
* @param propertiesToBind The list of property keys to bind.
|
|
57
|
+
* @param objectToBindTo The target object where properties will be bound.
|
|
58
|
+
* @returns The object with bound properties.
|
|
59
|
+
*/
|
|
10
60
|
static bindMany<T>(renderContext: VelcronRenderContext, definition: {
|
|
11
61
|
[P in keyof T]?: VelcronBindableProp<T[P]>;
|
|
12
62
|
}, propertiesToBind: Array<keyof T>, objectToBindTo: Partial<T>): T;
|