@omnia/fx-models 8.0.551-dev → 8.0.553-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/Layout.d.ts CHANGED
@@ -118,7 +118,8 @@ export declare enum SectionTypes {
118
118
  Tab = 2,
119
119
  Accordion = 3,
120
120
  Stepper = 4,
121
- Slider = 5
121
+ Slider = 5,
122
+ Container = 6
122
123
  }
123
124
  export interface Section<T extends SectionSettings = SectionSettings> extends LayoutItem {
124
125
  name?: string;
@@ -145,6 +146,8 @@ export interface SectionSettings extends LayoutItemSettings {
145
146
  minHeight: string;
146
147
  spacingBlock: SpacingValue;
147
148
  spacingColumn: SpacingValue;
149
+ spacingBlockV2: SpacingValue;
150
+ spacingColumnV2: SpacingValue;
148
151
  minWidthBlock: string;
149
152
  margin?: Spacing;
150
153
  marginSectionLeft?: SpacingValue;
@@ -162,6 +165,7 @@ export interface SectionSettings extends LayoutItemSettings {
162
165
  /** End This section replaces the old title settings */
163
166
  useFullSpace: boolean;
164
167
  useWidthFromTheme?: boolean;
168
+ useLayoutMargin?: boolean;
165
169
  useCustomTheme: boolean;
166
170
  themeDefinition: LegacyThemeDefinition;
167
171
  hidden?: boolean;
package/Layout.js CHANGED
@@ -8,6 +8,7 @@ var SectionTypes;
8
8
  SectionTypes[SectionTypes["Accordion"] = 3] = "Accordion";
9
9
  SectionTypes[SectionTypes["Stepper"] = 4] = "Stepper";
10
10
  SectionTypes[SectionTypes["Slider"] = 5] = "Slider";
11
+ SectionTypes[SectionTypes["Container"] = 6] = "Container";
11
12
  })(SectionTypes || (exports.SectionTypes = SectionTypes = {}));
12
13
  var JsonNullValueHandling;
13
14
  (function (JsonNullValueHandling) {
@@ -1,4 +1,4 @@
1
- import { BlueprintVariant, guid } from "internal/fx/shared/models";
1
+ import { BlueprintVariant, guid, SpacingPreset } from "internal/fx/shared/models";
2
2
  import { useThemeStore } from "./ThemeStore";
3
3
  export declare const useSpacingBlueprintStore: () => {
4
4
  state: {
@@ -35,6 +35,7 @@ export declare const useSpacingBlueprintStore: () => {
35
35
  scaling: (value: import("internal/fx/shared").SpacingValue) => boolean;
36
36
  };
37
37
  };
38
+ presetValue(preset: SpacingPreset): void;
38
39
  };
39
40
  deactivated(): void;
40
41
  } & {
@@ -3,6 +3,7 @@ import { guid } from "./Guid";
3
3
  import { TenantIdentifier } from "./Tenant";
4
4
  import { OmniaBackendRuntimes, OmniaClientRuntimes } from "./Enums";
5
5
  import { ActorId } from "./activity-hub";
6
+ import { ThemeBoot } from "./theme";
6
7
  export interface OmniaSharedBootstrapData {
7
8
  uiThreadId: guid;
8
9
  workerThreadId: guid;
@@ -32,6 +33,7 @@ export interface OmniaSharedBootstrapData {
32
33
  * Don't use it, only for test perf
33
34
  */
34
35
  location: typeof window.location;
36
+ theming?: ThemeBoot;
35
37
  }
36
38
  export interface OmniaAnalytics {
37
39
  paq: any[];
@@ -6,6 +6,7 @@ export type Spacing = {
6
6
  left?: SpacingValue;
7
7
  };
8
8
  export type SpacingScale = "l" | "s";
9
+ export type SpacingPreset = "preset-layout" | "preset-section" | "preset-column" | "preset-block";
9
10
  export interface SpacingDefinition {
10
11
  name?: string;
11
12
  xs?: number;
@@ -14,7 +15,7 @@ export interface SpacingDefinition {
14
15
  l?: number;
15
16
  xl?: number;
16
17
  }
17
- export type SpacingValue = "xs" | "s" | "m" | "l" | "xl" | "l:xs" | "l:s" | "l:m" | "l:l" | "l:xl" | "s:xs" | "s:s" | "s:m" | "s:l" | "s:xl" | number;
18
+ export type SpacingValue = "xs" | "s" | "m" | "l" | "xl" | "l:xs" | "l:s" | "l:m" | "l:l" | "l:xl" | "s:xs" | "s:s" | "s:m" | "s:l" | "s:xl" | number | SpacingPreset;
18
19
  export declare enum SpacingTypes {
19
20
  xs = "xs",
20
21
  s = "s",
@@ -4,6 +4,7 @@ import { Id } from "../Id";
4
4
  import { BlueprintVariant, BoxDimensions, ButtonBlueprint, ComponentBlueprints, ContainerFillBlueprints, MediaResources, SpacingBlueprint, TextFillBlueprints } from "./Blueprints";
5
5
  import { Color } from "./Color";
6
6
  import { LegacyBorderDefinition, LegacyThemeDefinition } from "./LegacyThemeDefinition";
7
+ import { Spacing, SpacingValue } from "./Spacing";
7
8
  import { ThemeBase } from "./ThemeBase";
8
9
  import { TypographyBlueprint } from "./Typography";
9
10
  export type ThemeContextType = "default" | "admin" | "designer" | "preview";
@@ -76,8 +77,18 @@ export interface ThemeDefinitionReference {
76
77
  export interface ThemeSettings {
77
78
  layoutWrapper?: {
78
79
  width?: number;
80
+ margin?: SpacingValue;
81
+ };
82
+ blockSpacing?: SpacingValue;
83
+ sectionMargin?: Spacing;
84
+ columnSpacing?: SpacingValue;
85
+ iconStyling?: {
86
+ style?: ThemeIconStyle;
87
+ pack?: ThemeIconPack;
79
88
  };
80
89
  }
90
+ export type ThemeIconStyle = "solid" | "regular" | "light" | "thin";
91
+ export type ThemeIconPack = "classic" | "duotone" | "sharp" | "sharp-duotone";
81
92
  export interface ResolvedThemeDefinition extends ThemeDefinition<ColorSchemas> {
82
93
  typography?: TypographyBlueprint;
83
94
  spacing?: SpacingBlueprint;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@omnia/fx-models",
3
3
  "license": "MIT",
4
- "version": "8.0.551-dev",
4
+ "version": "8.0.553-dev",
5
5
  "description": "Provide Omnia Fx Models Stuffs.",
6
6
  "scripts": {
7
7
  "test": "echo \"Error: no test specified\" && exit 1"
@@ -1,19 +1,21 @@
1
- import { IconTypes, IFabricIcon, IFlagIcon, IFontAwesomeIcon, IIcon, IMaterialIcon, ISvgIcon, MediaPickerImage, OButtonAffix, OTooltipPosition } from "@omnia/fx-models/internal-do-not-import-from-here/shared/models";
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";
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
- */
9
6
  export declare class FontAwesomeIcon implements IFontAwesomeIcon {
10
7
  faClass: string;
8
+ private style;
9
+ private pack;
11
10
  iconType: IconTypes;
12
- constructor(faClass: string);
11
+ private defaultIconPrefix;
12
+ constructor(faClass: string, style?: ThemeIconStyle, pack?: ThemeIconPack);
13
13
  toString(): string;
14
- setStyle(style: "solid" | "regular" | "light" | "duotone" | "thin", force?: boolean): this;
14
+ setStyle(style?: ThemeIconStyle, force?: boolean): this;
15
+ setPack(pack?: ThemeIconPack, force?: boolean): this;
16
+ private applyStyleAndPack;
17
+ private getPrefixFor;
15
18
  private setDefaultIconStyle;
16
- private setIconStyle;
17
19
  }
18
20
  export declare class MaterialIcon implements IMaterialIcon {
19
21
  maClass: string;
@@ -5,57 +5,101 @@ 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";
8
10
  class FontAwesomeIcon {
9
- constructor(faClass) {
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
+ // }
10
21
  this.faClass = faClass;
22
+ this.style = style;
23
+ this.pack = pack;
11
24
  this.iconType = models_1.IconTypes.FontAwesome;
25
+ this.defaultIconPrefix = "fa-solid";
12
26
  this.setDefaultIconStyle();
13
27
  }
14
28
  toString() {
15
29
  return this.faClass;
16
30
  }
17
- //
18
- setStyle(style, force) {
19
- if (!force && this.faClass.indexOf(" ") === -1) {
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)
20
43
  return;
21
- }
22
- /**Brand icons cannot have different styles */
23
- if (this.faClass.indexOf("fa-brands") > -1) {
44
+ if (!force && this.faClass.indexOf(" ") === -1)
24
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";
25
92
  }
26
- if (style === "solid") {
27
- this.setIconStyle("fas");
28
- }
29
- else if (style === "regular") {
30
- this.setIconStyle("fa");
31
- }
32
- else if (style === "light") {
33
- this.setIconStyle("fal");
34
- }
35
- else if (style === "duotone") {
36
- this.setIconStyle("fa-duotone");
37
- }
38
- else if (style === "thin") {
39
- this.setIconStyle("fat");
40
- }
41
- return this;
93
+ return this.defaultIconPrefix;
42
94
  }
43
95
  setDefaultIconStyle() {
44
96
  if (this.faClass) {
45
97
  const split = this.faClass.split(" ");
46
98
  if (split.length === 1) {
47
- this.setIconStyle("fa-duotone");
99
+ this.applyStyleAndPack(true);
48
100
  }
49
101
  }
50
102
  }
51
- setIconStyle(style) {
52
- if (!this.faClass) {
53
- return;
54
- }
55
- const split = this.faClass.split(" ");
56
- const end = split[split.length - 1];
57
- this.faClass = style + " " + end;
58
- }
59
103
  }
60
104
  exports.FontAwesomeIcon = FontAwesomeIcon;
61
105
  class MaterialIcon {