@omnia/fx-models 8.0.553-dev → 8.0.555-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.
@@ -1,4 +1,4 @@
1
1
  import { useThemeProviderStore } from "./ThemeProvider";
2
- type SetupThemeProvider = Pick<ReturnType<typeof useThemeProviderStore>["actions"], "registerStore" | "registerDefaultTypographyBlueprints" | "registerDefaultSpacingBlueprints" | "registerDefaultLightColorSchema" | "registerDefaultDarkColorSchema" | "registerComponentBlueprintStrategy" | "defineCustomFontLoader">;
2
+ type SetupThemeProvider = Pick<ReturnType<typeof useThemeProviderStore>["actions"], "registerStore" | "registerDefaultTypographyBlueprints" | "registerDefaultSpacingBlueprints" | "registerDefaultLightColorSchema" | "registerDefaultDarkColorSchema" | "registerComponentBlueprintStrategy" | "registerDefaultThemeTemplate" | "defineCustomFontLoader">;
3
3
  export declare function defineThemeProvider(setup: (ctx: SetupThemeProvider) => void): void;
4
4
  export {};
@@ -16,15 +16,12 @@ export declare const useThemeProviderStore: () => {
16
16
  setAdminTheme(theme: ResolvedThemeDefinition): void;
17
17
  setDefaultTheme(theme: ResolvedThemeDefinition): void;
18
18
  loadCustomFont(font: TypographyFontDefinition): void;
19
+ registerDefaultThemeTemplate(theme: ResolvedThemeDefinition): void;
19
20
  }>;
20
21
  get: {
21
22
  readonly adminTheme: ResolvedThemeDefinition;
22
23
  readonly defaultTheme: ResolvedThemeDefinition;
23
- readonly defaultTypographyBlueprints: TypographyBlueprint;
24
- readonly defaultSpacingBlueprints: SpacingBlueprint;
25
- readonly defaultLightColorSchema: ColorSchemas;
26
- readonly defaultDarkColorSchema: ColorSchemas;
27
- readonly componentBlueprintStrategy: ComponentBlueprintStrategyType;
24
+ readonly defaultThemeTemplate: ResolvedThemeDefinition;
28
25
  };
29
26
  readonly events: {
30
27
  onMutatedAdminTheme: import("internal/fx/shared").MessageBusExposeOnlySubscription<ResolvedThemeDefinition>;
@@ -32,7 +29,7 @@ export declare const useThemeProviderStore: () => {
32
29
  };
33
30
  validations: {
34
31
  checkPlatformStoreRegistered(): void;
35
- checkDefaultBlueprintsRegistered(type: "typography" | "spacing" | "light" | "dark" | "component"): void;
32
+ checkDefaultBlueprintsRegistered(type: "typography" | "spacing" | "light" | "dark" | "component" | "theme-template"): void;
36
33
  };
37
34
  } & {
38
35
  dispose?: () => void;
@@ -1,9 +1,7 @@
1
1
  export * from "./ColorManager";
2
2
  export * from "./ComponentBlueprintStore";
3
- export * from "./FontStore";
4
3
  export { useColorSchemaStore, type ColorSchemaStoreType, type InternalColorSchemaStoreType } from "./ColorSchemaStore";
5
4
  export * from "./SpacingBlueprintStore";
6
- export * from "./TemplateRegistrationStore";
7
5
  export * from "./ThemeContextStore";
8
6
  export * from "./ThemeMigrations";
9
7
  export * from "./ThemeNormalizer";
@@ -1,3 +1,4 @@
1
+ import { ThemeContextType } from "./theme";
1
2
  export declare enum IconTypes {
2
3
  FontAwesome = "IFontAwesomeIcon",
3
4
  Fabric = "IFabricIcon",
@@ -9,6 +10,7 @@ export declare enum IconTypes {
9
10
  export interface IIcon {
10
11
  iconType: IconTypes;
11
12
  role?: string;
13
+ themeType?: ThemeContextType;
12
14
  }
13
15
  export interface IFontAwesomeIcon extends IIcon {
14
16
  faClass: string;
@@ -40,6 +40,7 @@ export interface BuiltInComponentRenderers {
40
40
  "link": unknown;
41
41
  "motion": unknown;
42
42
  "scroll": unknown;
43
+ "markdown": unknown;
43
44
  }
44
45
  export interface ColorSchemaReference {
45
46
  name: string;
@@ -327,6 +328,12 @@ export interface VelcronFlowDefinition extends VelcronDefinition, VelcronColorSt
327
328
  placeholder?: VelcronBindableProp<string>;
328
329
  events?: VelcronOnUpdatedEvent;
329
330
  }
331
+ export interface VelcronMarkdownDefinition extends VelcronDefinition, VelcronColorStyling {
332
+ type: "markdown";
333
+ value?: VelcronBindableProp<string>;
334
+ placeholder?: VelcronBindableProp<string>;
335
+ events?: VelcronOnUpdatedEvent;
336
+ }
330
337
  export interface VelcronMotionDefinition extends VelcronDefinition {
331
338
  initial?: false | VariantDefinition;
332
339
  animate?: VariantDefinition;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@omnia/fx-models",
3
3
  "license": "MIT",
4
- "version": "8.0.553-dev",
4
+ "version": "8.0.555-dev",
5
5
  "description": "Provide Omnia Fx Models Stuffs.",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -1,21 +1,16 @@
1
- import { IconTypes, IFabricIcon, IFlagIcon, IFontAwesomeIcon, IIcon, IMaterialIcon, ISvgIcon, MediaPickerImage, OButtonAffix, OTooltipPosition, ThemeIconPack, ThemeIconStyle } from "@omnia/fx-models/internal-do-not-import-from-here/shared/models";
1
+ import { IconTypes, IFabricIcon, IFlagIcon, IFontAwesomeIcon, IIcon, IMaterialIcon, ISvgIcon, MediaPickerImage, OButtonAffix, OTooltipPosition } from "@omnia/fx-models/internal-do-not-import-from-here/shared/models";
2
2
  import { IconSources } from "../Enums";
3
3
  export interface ICustomIcon extends IIcon {
4
4
  customValue: string | MediaPickerImage;
5
5
  }
6
+ /**
7
+ * Class to create a guid
8
+ */
6
9
  export declare class FontAwesomeIcon implements IFontAwesomeIcon {
7
10
  faClass: string;
8
- private style;
9
- private pack;
10
11
  iconType: IconTypes;
11
- private defaultIconPrefix;
12
- constructor(faClass: string, style?: ThemeIconStyle, pack?: ThemeIconPack);
12
+ constructor(faClass: string);
13
13
  toString(): string;
14
- setStyle(style?: ThemeIconStyle, force?: boolean): this;
15
- setPack(pack?: ThemeIconPack, force?: boolean): this;
16
- private applyStyleAndPack;
17
- private getPrefixFor;
18
- private setDefaultIconStyle;
19
14
  }
20
15
  export declare class MaterialIcon implements IMaterialIcon {
21
16
  maClass: string;
@@ -5,101 +5,14 @@ const models_1 = require("@omnia/fx-models/internal-do-not-import-from-here/shar
5
5
  /**
6
6
  * Class to create a guid
7
7
  */
8
- const defaultIconStyle = "solid";
9
- const defaultIconPack = "classic";
10
8
  class FontAwesomeIcon {
11
- constructor(faClass, style = defaultIconStyle, pack = defaultIconPack) {
12
- // if (typeof omnia !== "undefined") {
13
- // const currentThemeIconDef = omnia.theming.defaultTheme?.settings?.iconStyling;
14
- // if (currentThemeIconDef) {
15
- // const currentPack = currentThemeIconDef?.pack;
16
- // const currentStyle = currentThemeIconDef?.style;
17
- // this.pack = currentPack || pack;
18
- // this.style = currentStyle || style;
19
- // }
20
- // }
9
+ constructor(faClass) {
21
10
  this.faClass = faClass;
22
- this.style = style;
23
- this.pack = pack;
24
11
  this.iconType = models_1.IconTypes.FontAwesome;
25
- this.defaultIconPrefix = "fa-solid";
26
- this.setDefaultIconStyle();
27
12
  }
28
13
  toString() {
29
14
  return this.faClass;
30
15
  }
31
- setStyle(style = defaultIconStyle, force) {
32
- this.style = style;
33
- this.applyStyleAndPack(force);
34
- return this;
35
- }
36
- setPack(pack = defaultIconPack, force) {
37
- this.pack = pack;
38
- this.applyStyleAndPack(force);
39
- return this;
40
- }
41
- applyStyleAndPack(force) {
42
- if (!this.faClass)
43
- return;
44
- if (!force && this.faClass.indexOf(" ") === -1)
45
- return;
46
- // Brand icons should not be modified
47
- if (this.faClass.indexOf("fa-brands") > -1)
48
- return;
49
- const split = this.faClass.split(" ");
50
- const end = split[split.length - 1];
51
- const prefix = this.getPrefixFor(this.pack, this.style);
52
- this.faClass = prefix + " " + end;
53
- }
54
- getPrefixFor(pack, style) {
55
- switch (pack) {
56
- case "classic":
57
- if (style === "solid")
58
- return "fa-solid";
59
- if (style === "light")
60
- return "fa-light";
61
- if (style === "regular")
62
- return "fa-regular";
63
- if (style === "thin")
64
- return "fa-thin";
65
- case "duotone":
66
- if (style === "light")
67
- return "fa-duotone fa-light";
68
- if (style === "regular")
69
- return "fa-duotone fa-regular";
70
- if (style === "solid")
71
- return "fa-duotone fa-solid";
72
- if (style === "thin")
73
- return "fa-duotone fa-thin";
74
- case "sharp":
75
- if (style === "light")
76
- return "fa-sharp fa-light";
77
- if (style === "regular")
78
- return "fa-sharp fa-regular";
79
- if (style === "solid")
80
- return "fa-sharp fa-solid";
81
- if (style === "thin")
82
- return "fa-sharp fa-thin";
83
- case "sharp-duotone":
84
- if (style === "light")
85
- return "fa-sharp-duotone fa-light";
86
- if (style === "regular")
87
- return "fa-sharp-duotone fa-regular";
88
- if (style === "solid")
89
- return "fa-sharp-duotone fa-solid";
90
- if (style === "thin")
91
- return "fa-sharp-duotone fa-thin";
92
- }
93
- return this.defaultIconPrefix;
94
- }
95
- setDefaultIconStyle() {
96
- if (this.faClass) {
97
- const split = this.faClass.split(" ");
98
- if (split.length === 1) {
99
- this.applyStyleAndPack(true);
100
- }
101
- }
102
- }
103
16
  }
104
17
  exports.FontAwesomeIcon = FontAwesomeIcon;
105
18
  class MaterialIcon {
@@ -1,18 +0,0 @@
1
- import { Future, ITemplateRegistration, TypographyFontDefinition } from "internal/fx/shared/models";
2
- export declare const useFontStore: () => {
3
- actions: import("internal/fx/shared").StoreReturnDefineAction<{
4
- ensureLoadFonts: () => Future<ITemplateRegistration<TypographyFontDefinition, import("internal/fx/shared").TemplateRegistrationType>[]>;
5
- addFont(font: TypographyFontDefinition): void;
6
- editFont(font: TypographyFontDefinition): void;
7
- onFinishLoad(): Future<Record<string, ITemplateRegistration<any, import("internal/fx/shared").TemplateRegistrationType>>>;
8
- saveFont(): Promise<boolean>;
9
- delete(font: TypographyFontDefinition): Promise<void>;
10
- }>;
11
- get: {
12
- readonly availableFonts: TypographyFontDefinition[];
13
- findFont(family: string): ITemplateRegistration<TypographyFontDefinition, import("internal/fx/shared").TemplateRegistrationType>;
14
- readonly finishLoad: boolean;
15
- };
16
- } & {
17
- dispose?: () => void;
18
- };
@@ -1,20 +0,0 @@
1
- import { guid, ITemplateRegistration, TemplateRegistrationType, Future } from "internal/fx/shared/models";
2
- export declare const useTemplateRegistrationStore: () => {
3
- state: {
4
- registrations: Record<string, ITemplateRegistration<any, TemplateRegistrationType>>;
5
- };
6
- events: import("internal/fx/shared").StoreEvents<{
7
- registrations: Record<string, ITemplateRegistration<any, TemplateRegistrationType>>;
8
- }, Record<string, import("internal/fx/shared").IMessageBusTopicPublishSubscriber<any>>>;
9
- actions: import("internal/fx/shared").StoreReturnDefineAction<{
10
- upsertRegistration<TTemplateRegistration extends ITemplateRegistration<any>>(registration: TTemplateRegistration): Promise<boolean>;
11
- deleteRegistration(registrationId: guid): Promise<boolean>;
12
- ensureLoadTemplates: () => Future<Record<string, ITemplateRegistration<any, TemplateRegistrationType>>>;
13
- }>;
14
- get: {
15
- byId: <TTemplateRegistration extends ITemplateRegistration<any>>(id: guid) => ITemplateRegistration<any, TemplateRegistrationType>;
16
- getByType: <TTemplateRegistration extends ITemplateRegistration<any>>(type: TemplateRegistrationType) => Array<TTemplateRegistration>;
17
- };
18
- } & {
19
- dispose?: () => void;
20
- };