@esri/hub-common 14.9.1 → 14.10.0

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.
Files changed (147) hide show
  1. package/dist/esm/content/HubContent.js.map +1 -1
  2. package/dist/esm/content/_internal/ContentUiSchemaEdit.js +127 -113
  3. package/dist/esm/content/_internal/ContentUiSchemaEdit.js.map +1 -1
  4. package/dist/esm/core/schemas/getEditorConfig.js +1 -3
  5. package/dist/esm/core/schemas/getEditorConfig.js.map +1 -1
  6. package/dist/esm/core/schemas/index.js +0 -1
  7. package/dist/esm/core/schemas/index.js.map +1 -1
  8. package/dist/esm/core/schemas/internal/getEntityEditorSchemas.js +23 -27
  9. package/dist/esm/core/schemas/internal/getEntityEditorSchemas.js.map +1 -1
  10. package/dist/esm/core/schemas/internal/getFeaturedImageUrl.js +3 -1
  11. package/dist/esm/core/schemas/internal/getFeaturedImageUrl.js.map +1 -1
  12. package/dist/esm/core/schemas/internal/index.js +0 -1
  13. package/dist/esm/core/schemas/internal/index.js.map +1 -1
  14. package/dist/esm/discussions/HubDiscussion.js.map +1 -1
  15. package/dist/esm/discussions/_internal/DiscussionUiSchemaCreate.js +23 -21
  16. package/dist/esm/discussions/_internal/DiscussionUiSchemaCreate.js.map +1 -1
  17. package/dist/esm/discussions/_internal/DiscussionUiSchemaEdit.js +167 -154
  18. package/dist/esm/discussions/_internal/DiscussionUiSchemaEdit.js.map +1 -1
  19. package/dist/esm/groups/HubGroup.js.map +1 -1
  20. package/dist/esm/groups/_internal/GroupUiSchemaEdit.js +53 -50
  21. package/dist/esm/groups/_internal/GroupUiSchemaEdit.js.map +1 -1
  22. package/dist/esm/groups/_internal/GroupUiSchemaSettings.js +39 -36
  23. package/dist/esm/groups/_internal/GroupUiSchemaSettings.js.map +1 -1
  24. package/dist/esm/initiatives/HubInitiative.js +1 -15
  25. package/dist/esm/initiatives/HubInitiative.js.map +1 -1
  26. package/dist/esm/initiatives/_internal/InitiativeUiSchemaCreate.js +118 -104
  27. package/dist/esm/initiatives/_internal/InitiativeUiSchemaCreate.js.map +1 -1
  28. package/dist/esm/initiatives/_internal/InitiativeUiSchemaEdit.js +108 -95
  29. package/dist/esm/initiatives/_internal/InitiativeUiSchemaEdit.js.map +1 -1
  30. package/dist/esm/pages/HubPage.js +1 -5
  31. package/dist/esm/pages/HubPage.js.map +1 -1
  32. package/dist/esm/pages/_internal/PageUiSchemaEdit.js +108 -97
  33. package/dist/esm/pages/_internal/PageUiSchemaEdit.js.map +1 -1
  34. package/dist/esm/projects/HubProject.js +1 -1
  35. package/dist/esm/projects/HubProject.js.map +1 -1
  36. package/dist/esm/projects/_internal/ProjectUiSchemaCreate.js +124 -113
  37. package/dist/esm/projects/_internal/ProjectUiSchemaCreate.js.map +1 -1
  38. package/dist/esm/projects/_internal/ProjectUiSchemaEdit.js +206 -191
  39. package/dist/esm/projects/_internal/ProjectUiSchemaEdit.js.map +1 -1
  40. package/dist/esm/projects/edit.js +0 -13
  41. package/dist/esm/projects/edit.js.map +1 -1
  42. package/dist/esm/sites/HubSite.js.map +1 -1
  43. package/dist/esm/sites/_internal/SiteSchema.js +1 -1
  44. package/dist/esm/sites/_internal/SiteSchema.js.map +1 -1
  45. package/dist/esm/sites/_internal/SiteUiSchemaCreate.js +118 -110
  46. package/dist/esm/sites/_internal/SiteUiSchemaCreate.js.map +1 -1
  47. package/dist/esm/sites/_internal/SiteUiSchemaEdit.js +106 -95
  48. package/dist/esm/sites/_internal/SiteUiSchemaEdit.js.map +1 -1
  49. package/dist/node/content/HubContent.js.map +1 -1
  50. package/dist/node/content/_internal/ContentUiSchemaEdit.js +128 -114
  51. package/dist/node/content/_internal/ContentUiSchemaEdit.js.map +1 -1
  52. package/dist/node/core/schemas/getEditorConfig.js +1 -3
  53. package/dist/node/core/schemas/getEditorConfig.js.map +1 -1
  54. package/dist/node/core/schemas/index.js +0 -1
  55. package/dist/node/core/schemas/index.js.map +1 -1
  56. package/dist/node/core/schemas/internal/getEntityEditorSchemas.js +23 -27
  57. package/dist/node/core/schemas/internal/getEntityEditorSchemas.js.map +1 -1
  58. package/dist/node/core/schemas/internal/getFeaturedImageUrl.js +3 -1
  59. package/dist/node/core/schemas/internal/getFeaturedImageUrl.js.map +1 -1
  60. package/dist/node/core/schemas/internal/index.js +0 -1
  61. package/dist/node/core/schemas/internal/index.js.map +1 -1
  62. package/dist/node/discussions/HubDiscussion.js.map +1 -1
  63. package/dist/node/discussions/_internal/DiscussionUiSchemaCreate.js +24 -22
  64. package/dist/node/discussions/_internal/DiscussionUiSchemaCreate.js.map +1 -1
  65. package/dist/node/discussions/_internal/DiscussionUiSchemaEdit.js +168 -155
  66. package/dist/node/discussions/_internal/DiscussionUiSchemaEdit.js.map +1 -1
  67. package/dist/node/groups/HubGroup.js.map +1 -1
  68. package/dist/node/groups/_internal/GroupUiSchemaEdit.js +54 -51
  69. package/dist/node/groups/_internal/GroupUiSchemaEdit.js.map +1 -1
  70. package/dist/node/groups/_internal/GroupUiSchemaSettings.js +40 -37
  71. package/dist/node/groups/_internal/GroupUiSchemaSettings.js.map +1 -1
  72. package/dist/node/initiatives/HubInitiative.js +1 -15
  73. package/dist/node/initiatives/HubInitiative.js.map +1 -1
  74. package/dist/node/initiatives/_internal/InitiativeUiSchemaCreate.js +119 -105
  75. package/dist/node/initiatives/_internal/InitiativeUiSchemaCreate.js.map +1 -1
  76. package/dist/node/initiatives/_internal/InitiativeUiSchemaEdit.js +109 -96
  77. package/dist/node/initiatives/_internal/InitiativeUiSchemaEdit.js.map +1 -1
  78. package/dist/node/pages/HubPage.js +1 -5
  79. package/dist/node/pages/HubPage.js.map +1 -1
  80. package/dist/node/pages/_internal/PageUiSchemaEdit.js +109 -98
  81. package/dist/node/pages/_internal/PageUiSchemaEdit.js.map +1 -1
  82. package/dist/node/projects/HubProject.js +1 -1
  83. package/dist/node/projects/HubProject.js.map +1 -1
  84. package/dist/node/projects/_internal/ProjectUiSchemaCreate.js +125 -114
  85. package/dist/node/projects/_internal/ProjectUiSchemaCreate.js.map +1 -1
  86. package/dist/node/projects/_internal/ProjectUiSchemaEdit.js +207 -192
  87. package/dist/node/projects/_internal/ProjectUiSchemaEdit.js.map +1 -1
  88. package/dist/node/projects/edit.js +1 -15
  89. package/dist/node/projects/edit.js.map +1 -1
  90. package/dist/node/sites/HubSite.js.map +1 -1
  91. package/dist/node/sites/_internal/SiteSchema.js +1 -1
  92. package/dist/node/sites/_internal/SiteSchema.js.map +1 -1
  93. package/dist/node/sites/_internal/SiteUiSchemaCreate.js +119 -111
  94. package/dist/node/sites/_internal/SiteUiSchemaCreate.js.map +1 -1
  95. package/dist/node/sites/_internal/SiteUiSchemaEdit.js +107 -96
  96. package/dist/node/sites/_internal/SiteUiSchemaEdit.js.map +1 -1
  97. package/dist/types/content/HubContent.d.ts +2 -2
  98. package/dist/types/content/_internal/ContentUiSchemaEdit.d.ts +6 -1
  99. package/dist/types/core/schemas/index.d.ts +0 -1
  100. package/dist/types/core/schemas/internal/getEntityEditorSchemas.d.ts +4 -2
  101. package/dist/types/core/schemas/internal/index.d.ts +0 -1
  102. package/dist/types/core/schemas/types.d.ts +1 -1
  103. package/dist/types/discussions/HubDiscussion.d.ts +2 -2
  104. package/dist/types/discussions/_internal/DiscussionUiSchemaCreate.d.ts +6 -4
  105. package/dist/types/discussions/_internal/DiscussionUiSchemaEdit.d.ts +7 -5
  106. package/dist/types/groups/HubGroup.d.ts +2 -2
  107. package/dist/types/groups/_internal/GroupUiSchemaEdit.d.ts +7 -5
  108. package/dist/types/groups/_internal/GroupUiSchemaSettings.d.ts +6 -4
  109. package/dist/types/initiatives/HubInitiative.d.ts +2 -14
  110. package/dist/types/initiatives/_internal/InitiativeUiSchemaCreate.d.ts +10 -5
  111. package/dist/types/initiatives/_internal/InitiativeUiSchemaEdit.d.ts +7 -3
  112. package/dist/types/pages/HubPage.d.ts +2 -4
  113. package/dist/types/pages/_internal/PageUiSchemaEdit.d.ts +7 -5
  114. package/dist/types/projects/HubProject.d.ts +2 -2
  115. package/dist/types/projects/_internal/ProjectUiSchemaCreate.d.ts +7 -5
  116. package/dist/types/projects/_internal/ProjectUiSchemaEdit.d.ts +7 -5
  117. package/dist/types/projects/edit.d.ts +0 -10
  118. package/dist/types/sites/HubSite.d.ts +2 -2
  119. package/dist/types/sites/_internal/SiteSchema.d.ts +1 -1
  120. package/dist/types/sites/_internal/SiteUiSchemaCreate.d.ts +10 -5
  121. package/dist/types/sites/_internal/SiteUiSchemaEdit.d.ts +5 -3
  122. package/package.json +1 -1
  123. package/dist/esm/core/schemas/getEntityEditorSchemas.js +0 -94
  124. package/dist/esm/core/schemas/getEntityEditorSchemas.js.map +0 -1
  125. package/dist/esm/core/schemas/internal/applyUiSchemaElementOptions.js +0 -31
  126. package/dist/esm/core/schemas/internal/applyUiSchemaElementOptions.js.map +0 -1
  127. package/dist/esm/core/schemas/internal/configOptionHelpers.js +0 -98
  128. package/dist/esm/core/schemas/internal/configOptionHelpers.js.map +0 -1
  129. package/dist/esm/core/schemas/internal/getConfigOptions.js +0 -15
  130. package/dist/esm/core/schemas/internal/getConfigOptions.js.map +0 -1
  131. package/dist/esm/core/schemas/internal/getEditorConfigOptions.js +0 -37
  132. package/dist/esm/core/schemas/internal/getEditorConfigOptions.js.map +0 -1
  133. package/dist/node/core/schemas/getEntityEditorSchemas.js +0 -97
  134. package/dist/node/core/schemas/getEntityEditorSchemas.js.map +0 -1
  135. package/dist/node/core/schemas/internal/applyUiSchemaElementOptions.js +0 -35
  136. package/dist/node/core/schemas/internal/applyUiSchemaElementOptions.js.map +0 -1
  137. package/dist/node/core/schemas/internal/configOptionHelpers.js +0 -101
  138. package/dist/node/core/schemas/internal/configOptionHelpers.js.map +0 -1
  139. package/dist/node/core/schemas/internal/getConfigOptions.js +0 -19
  140. package/dist/node/core/schemas/internal/getConfigOptions.js.map +0 -1
  141. package/dist/node/core/schemas/internal/getEditorConfigOptions.js +0 -41
  142. package/dist/node/core/schemas/internal/getEditorConfigOptions.js.map +0 -1
  143. package/dist/types/core/schemas/getEntityEditorSchemas.d.ts +0 -14
  144. package/dist/types/core/schemas/internal/applyUiSchemaElementOptions.d.ts +0 -10
  145. package/dist/types/core/schemas/internal/configOptionHelpers.d.ts +0 -6
  146. package/dist/types/core/schemas/internal/getConfigOptions.d.ts +0 -12
  147. package/dist/types/core/schemas/internal/getEditorConfigOptions.d.ts +0 -11
@@ -1,8 +1,10 @@
1
- import { IUiSchema } from "../../core";
1
+ import { IUiSchema } from "../../core/schemas/types";
2
+ import { IArcGISContext } from "../../ArcGISContext";
3
+ import { IHubDiscussion } from "../../core/types";
2
4
  /**
3
5
  * @private
4
- * complete edit uiSchema for Hub discussions - this defines
5
- * how the schema properties should be rendered in the
6
- * discussion editing experience
6
+ * constructs the complete edit uiSchema for Hub Discussions.
7
+ * This defines how the schema properties should be
8
+ * rendered in the discussion editing experience
7
9
  */
8
- export declare const uiSchema: IUiSchema;
10
+ export declare const buildUiSchema: (i18nScope: string, entity: IHubDiscussion, context: IArcGISContext) => Promise<IUiSchema>;
@@ -4,7 +4,7 @@ import { IWithStoreBehavior } from "../core/behaviors/IWithStoreBehavior";
4
4
  import { IWithPermissionBehavior } from "../core/behaviors/IWithPermissionBehavior";
5
5
  import { IArcGISContext } from "../ArcGISContext";
6
6
  import { IEditorConfig, IWithEditorBehavior } from "../core/behaviors/IWithEditorBehavior";
7
- import { EditorType } from "../core/schemas/types";
7
+ import { GroupEditorType } from "./_internal/GroupSchema";
8
8
  /**
9
9
  * Hub Group Class
10
10
  */
@@ -99,7 +99,7 @@ export declare class HubGroup implements IWithStoreBehavior<IHubGroup>, IWithPer
99
99
  * @param id
100
100
  */
101
101
  removePermissionPolicy(permission: Permission, id: string): void;
102
- getEditorConfig(i18nScope: string, type: EditorType): Promise<IEditorConfig>;
102
+ getEditorConfig(i18nScope: string, type: GroupEditorType): Promise<IEditorConfig>;
103
103
  /**
104
104
  * Return the group as an editor object
105
105
  */
@@ -1,8 +1,10 @@
1
- import { IUiSchema } from "../../core";
1
+ import { IUiSchema } from "../../core/schemas/types";
2
+ import { IArcGISContext } from "../../ArcGISContext";
3
+ import { IHubGroup } from "../../core/types";
2
4
  /**
3
5
  * @private
4
- * Complete edit uiSchema for Hub Groups - this defines
5
- * how the schema properties should be rendered in the
6
- * group editing experience
6
+ * constructs the complete edit uiSchema for Hub Groups
7
+ * This defines how the schema properties should be
8
+ * rendered in the group editing experience
7
9
  */
8
- export declare const uiSchema: IUiSchema;
10
+ export declare const buildUiSchema: (i18nScope: string, entity: IHubGroup, context: IArcGISContext) => Promise<IUiSchema>;
@@ -1,8 +1,10 @@
1
1
  import { IUiSchema } from "../../core";
2
+ import { IArcGISContext } from "../../ArcGISContext";
3
+ import { IHubGroup } from "../../core/types";
2
4
  /**
3
5
  * @private
4
- * Complete settings uiSchema for Hub Groups - this defines
5
- * how the schema properties should be rendered in the
6
- * group settings experience
6
+ * constructs the complete settings uiSchema for Hub Groups
7
+ * This defines how the schema properties should be
8
+ * rendered in the group settings experience
7
9
  */
8
- export declare const uiSchema: IUiSchema;
10
+ export declare const buildUiSchema: (i18nScope: string, entity: IHubGroup, context: IArcGISContext) => Promise<IUiSchema>;
@@ -1,4 +1,3 @@
1
- import { EditorType } from "../core/schemas/types";
2
1
  import { IEntityEditorContext } from "../core/types/HubEntityEditor";
3
2
  import { Catalog } from "../search";
4
3
  import { IArcGISContext } from "../ArcGISContext";
@@ -6,7 +5,7 @@ import { HubItemEntity } from "../core/HubItemEntity";
6
5
  import { InitiativeEditorType } from "./_internal/InitiativeSchema";
7
6
  import { IWithMetricsBehavior } from "../core/behaviors/IWithMetricsBehavior";
8
7
  import { IConvertToCardModelOpts, IHubCardViewModel } from "../core/types/IHubCardViewModel";
9
- import { IHubInitiative, IWithCatalogBehavior, IWithStoreBehavior, IWithSharingBehavior, UiSchemaElementOptions, IEditorConfig, IResolvedMetric, IWithCardBehavior, IWithEditorBehavior, IHubInitiativeEditor } from "../core";
8
+ import { IHubInitiative, IWithCatalogBehavior, IWithStoreBehavior, IWithSharingBehavior, IEditorConfig, IResolvedMetric, IWithCardBehavior, IWithEditorBehavior, IHubInitiativeEditor } from "../core";
10
9
  /**
11
10
  * Hub Initiative Class
12
11
  */
@@ -45,17 +44,6 @@ export declare class HubInitiative extends HubItemEntity<IHubInitiative> impleme
45
44
  * @returns
46
45
  */
47
46
  static fetch(identifier: string, context: IArcGISContext): Promise<HubInitiative>;
48
- /**
49
- * Static method to get the editor config for the HubInitiative entity.
50
- * @param i18nScope translation scope to be interpolated into the uiSchema
51
- * @param type editor type - corresonds to the returned uiSchema
52
- * @param options optional hash of dynamic uiSchema element options
53
- *
54
- * Note: typescript does not have a means to specify static methods in interfaces
55
- * so while this is the implementation of IWithEditorBehavior, it is not enforced
56
- * by the compiler.
57
- */
58
- static getEditorConfig(i18nScope: string, type: InitiativeEditorType, options?: UiSchemaElementOptions[]): Promise<IEditorConfig>;
59
47
  private static applyDefaults;
60
48
  /**
61
49
  * Apply a new state to the instance
@@ -87,7 +75,7 @@ export declare class HubInitiative extends HubItemEntity<IHubInitiative> impleme
87
75
  * @param opts view model options
88
76
  */
89
77
  convertToCardModel(opts?: IConvertToCardModelOpts): IHubCardViewModel;
90
- getEditorConfig(i18nScope: string, type: EditorType): Promise<IEditorConfig>;
78
+ getEditorConfig(i18nScope: string, type: InitiativeEditorType): Promise<IEditorConfig>;
91
79
  /**
92
80
  * Return the project as an editor object
93
81
  * @param editorContext
@@ -1,8 +1,13 @@
1
- import { IUiSchema } from "../../core";
1
+ import { IArcGISContext } from "../../ArcGISContext";
2
+ import { IHubInitiative } from "../../core/types";
3
+ import { IUiSchema } from "../../core/schemas/types";
2
4
  /**
3
5
  * @private
4
- * minimal create uiSchema for Hub Projects - this defines
5
- * how the schema properties should be rendered in the
6
- * project creation experience
6
+ * constructs the minimal create uiSchema for Hub Initiatives.
7
+ * This defines how the schema properties should be rendered
8
+ * in the initiative creation experience
9
+ *
10
+ * TODO: this was copied from projects and is just a placeholder
11
+ * for now - it isn't being used anywhere in the application
7
12
  */
8
- export declare const uiSchema: IUiSchema;
13
+ export declare const buildUiSchema: (i18nScope: string, entity: IHubInitiative, context: IArcGISContext) => Promise<IUiSchema>;
@@ -1,6 +1,10 @@
1
- import { IUiSchema } from "../../core";
1
+ import { IUiSchema } from "../../core/schemas/types";
2
+ import { IArcGISContext } from "../../ArcGISContext";
3
+ import { IHubInitiative } from "../../core/types";
2
4
  /**
3
5
  * @private
4
- * complete edit UI Schema for Hub Initiatives
6
+ * constructs the complete edit uiSchema for Hub Projects.
7
+ * This defines how the schema properties should be
8
+ * rendered in the project editing experience
5
9
  */
6
- export declare const uiSchema: IUiSchema;
10
+ export declare const buildUiSchema: (i18nScope: string, entity: IHubInitiative, context: IArcGISContext) => Promise<IUiSchema>;
@@ -1,5 +1,4 @@
1
- import { EditorType } from "../core/schemas/types";
2
- import { IHubPage, IWithStoreBehavior, IWithSharingBehavior, UiSchemaElementOptions, IHubPageEditor, IEntityEditorContext } from "../core";
1
+ import { IHubPage, IWithStoreBehavior, IWithSharingBehavior, IHubPageEditor, IEntityEditorContext } from "../core";
3
2
  import { IArcGISContext } from "../ArcGISContext";
4
3
  import { HubItemEntity } from "../core/HubItemEntity";
5
4
  import { IEditorConfig, IWithEditorBehavior } from "../core/behaviors/IWithEditorBehavior";
@@ -38,7 +37,6 @@ export declare class HubPage extends HubItemEntity<IHubPage> implements IWithSto
38
37
  * @returns
39
38
  */
40
39
  static fetch(identifier: string, context: IArcGISContext): Promise<HubPage>;
41
- static getEditorConfig(i18nScope: string, type: PageEditorType, options?: UiSchemaElementOptions[]): Promise<IEditorConfig>;
42
40
  private static applyDefaults;
43
41
  /**
44
42
  * Apply a new state to the instance
@@ -57,7 +55,7 @@ export declare class HubPage extends HubItemEntity<IHubPage> implements IWithSto
57
55
  * @returns
58
56
  */
59
57
  delete(): Promise<void>;
60
- getEditorConfig(i18nScope: string, type: EditorType): Promise<IEditorConfig>;
58
+ getEditorConfig(i18nScope: string, type: PageEditorType): Promise<IEditorConfig>;
61
59
  /**
62
60
  * Return the project as an editor object
63
61
  * @param editorContext
@@ -1,8 +1,10 @@
1
- import { IUiSchema } from "../../core";
1
+ import { IUiSchema } from "../../core/schemas/types";
2
+ import { IArcGISContext } from "../../ArcGISContext";
3
+ import { IHubPage } from "../../core/types";
2
4
  /**
3
5
  * @private
4
- * complete edit uiSchema for Hub Projects - this defines
5
- * how the schema properties should be rendered in the
6
- * project editing experience
6
+ * constructs the complete edit uiSchema for Hub Pages.
7
+ * This defines how the schema properties should be
8
+ * rendered in the page editing experience
7
9
  */
8
- export declare const uiSchema: IUiSchema;
10
+ export declare const buildUiSchema: (i18nScope: string, entity: IHubPage, context: IArcGISContext) => Promise<IUiSchema>;
@@ -1,11 +1,11 @@
1
1
  import { IHubProject, IWithCatalogBehavior, IWithStoreBehavior, IWithSharingBehavior, IResolvedMetric, IWithCardBehavior, IHubProjectEditor, IEntityEditorContext } from "../core";
2
- import { EditorType } from "../core/schemas/types";
3
2
  import { Catalog } from "../search";
4
3
  import { IArcGISContext } from "../ArcGISContext";
5
4
  import { HubItemEntity } from "../core/HubItemEntity";
6
5
  import { IEditorConfig, IWithEditorBehavior } from "../core/behaviors/IWithEditorBehavior";
7
6
  import { IWithMetricsBehavior } from "../core/behaviors/IWithMetricsBehavior";
8
7
  import { IConvertToCardModelOpts, IHubCardViewModel } from "../core/types/IHubCardViewModel";
8
+ import { ProjectEditorType } from "./_internal/ProjectSchema";
9
9
  /**
10
10
  * Hub Project Class
11
11
  */
@@ -58,7 +58,7 @@ export declare class HubProject extends HubItemEntity<IHubProject> implements IW
58
58
  * @param opts view model options
59
59
  */
60
60
  convertToCardModel(opts?: IConvertToCardModelOpts): IHubCardViewModel;
61
- getEditorConfig(i18nScope: string, type: EditorType): Promise<IEditorConfig>;
61
+ getEditorConfig(i18nScope: string, type: ProjectEditorType): Promise<IEditorConfig>;
62
62
  /**
63
63
  * Return the project as an editor object
64
64
  * @param editorContext
@@ -1,8 +1,10 @@
1
- import { IUiSchema } from "../../core";
1
+ import { IArcGISContext } from "../../ArcGISContext";
2
+ import { IHubProject } from "../../core/types";
3
+ import { IUiSchema } from "../../core/schemas/types";
2
4
  /**
3
5
  * @private
4
- * minimal create uiSchema for Hub Projects - this defines
5
- * how the schema properties should be rendered in the
6
- * project creation experience
6
+ * constructs the minimal create uiSchema for Hub Projects.
7
+ * This defines how the schema properties should be rendered
8
+ * in the project creation experience
7
9
  */
8
- export declare const uiSchema: IUiSchema;
10
+ export declare const buildUiSchema: (i18nScope: string, entity: IHubProject, context: IArcGISContext) => Promise<IUiSchema>;
@@ -1,8 +1,10 @@
1
- import { IUiSchema } from "../../core";
1
+ import { IArcGISContext } from "../../ArcGISContext";
2
+ import { IHubProject } from "../../core/types";
3
+ import { IUiSchema } from "../../core/schemas/types";
2
4
  /**
3
5
  * @private
4
- * complete edit uiSchema for Hub Projects - this defines
5
- * how the schema properties should be rendered in the
6
- * project editing experience
6
+ * constructs the complete edit uiSchema for Hub Projects.
7
+ * This defines how the schema properties should be
8
+ * rendered in the project editing experience
7
9
  */
8
- export declare const uiSchema: IUiSchema;
10
+ export declare const buildUiSchema: (i18nScope: string, entity: IHubProject, context: IArcGISContext) => Promise<IUiSchema>;
@@ -1,9 +1,6 @@
1
1
  import { IUserRequestOptions } from "@esri/arcgis-rest-auth";
2
2
  import { IPortal } from "@esri/arcgis-rest-portal";
3
3
  import { IHubProject, IHubProjectEditor } from "../core/types";
4
- import { ProjectEditorType } from "./_internal/ProjectSchema";
5
- import { UiSchemaElementOptions } from "../core/schemas";
6
- import { IEditorConfig } from "../core/behaviors/IWithEditorBehavior";
7
4
  /**
8
5
  * @private
9
6
  * Create a new Hub Project item
@@ -35,10 +32,3 @@ export declare function updateProject(project: IHubProject, requestOptions: IUse
35
32
  * @param requestOptions
36
33
  */
37
34
  export declare function deleteProject(id: string, requestOptions: IUserRequestOptions): Promise<void>;
38
- /**
39
- * Get the editor config for for the HubProject entity.
40
- * @param i18nScope translation scope to be interpolated into the uiSchema
41
- * @param type editor type - corresonds to the returned uiSchema
42
- * @param options optional hash of dynamic uiSchema element options
43
- */
44
- export declare function getHubProjectEditorConfig(i18nScope: string, type: ProjectEditorType, options?: UiSchemaElementOptions[]): Promise<IEditorConfig>;
@@ -2,12 +2,12 @@ import { IHubSite, IWithPermissionBehavior, IWithCatalogBehavior, IWithStoreBeha
2
2
  import { Catalog } from "../search";
3
3
  import { IArcGISContext } from "../ArcGISContext";
4
4
  import { HubItemEntity } from "../core/HubItemEntity";
5
- import { EditorType } from "../core/schemas/types";
6
5
  import { IEditorConfig, IWithEditorBehavior } from "../core/behaviors/IWithEditorBehavior";
7
6
  import { IEntityEditorContext } from "../core/types/HubEntityEditor";
8
7
  import { IContainsResponse, IDeepCatalogInfo } from "../search";
9
8
  import { ICreateVersionOptions, IVersion, IVersionMetadata } from "../versioning";
10
9
  import { IHubSiteEditor } from "../index";
10
+ import { SiteEditorType } from "./_internal/SiteSchema";
11
11
  /**
12
12
  * Hub Site Class
13
13
  * NOTE: This is a minimal implementation. Create operations are not supported at this time
@@ -135,7 +135,7 @@ export declare class HubSite extends HubItemEntity<IHubSite> implements IWithSto
135
135
  deleteVersion(versionId: string): Promise<{
136
136
  success: boolean;
137
137
  }>;
138
- getEditorConfig(i18nScope: string, type: EditorType): Promise<IEditorConfig>;
138
+ getEditorConfig(i18nScope: string, type: SiteEditorType): Promise<IEditorConfig>;
139
139
  /**
140
140
  * Return the project as an editor object
141
141
  * @param editorContext
@@ -1,6 +1,6 @@
1
1
  import { IConfigurationSchema } from "../../core";
2
2
  export declare type SiteEditorType = (typeof SiteEditorTypes)[number];
3
- export declare const SiteEditorTypes: readonly ["hub:site:edit"];
3
+ export declare const SiteEditorTypes: readonly ["hub:site:edit", "hub:site:create"];
4
4
  /**
5
5
  * defines the JSON schema for a Hub Site's editable fields
6
6
  */
@@ -1,8 +1,13 @@
1
- import { IUiSchema } from "../../core";
1
+ import { IArcGISContext } from "../../ArcGISContext";
2
+ import { IHubSite } from "../../core/types";
3
+ import { IUiSchema } from "../../core/schemas/types";
2
4
  /**
3
5
  * @private
4
- * minimal create uiSchema for Hub Projects - this defines
5
- * how the schema properties should be rendered in the
6
- * project creation experience
6
+ * constructs the minimal create uiSchema for Hub Sites.
7
+ * This defines how the schema properties should be rendered
8
+ * in the site creation experience
9
+ *
10
+ * TODO: this was copied from projects and is just a placeholder
11
+ * for now - it isn't being used anywhere in the application
7
12
  */
8
- export declare const uiSchema: IUiSchema;
13
+ export declare const buildUiSchema: (i18nScope: string, entity: IHubSite, context: IArcGISContext) => Promise<IUiSchema>;
@@ -1,8 +1,10 @@
1
- import { IUiSchema } from "../../core";
1
+ import { IArcGISContext } from "../../ArcGISContext";
2
+ import { IUiSchema } from "../../core/schemas/types";
3
+ import { IHubSite } from "../../core/types";
2
4
  /**
3
5
  * @private
4
- * complete edit uiSchema for Hub Projects - this defines
6
+ * construct edit uiSchema for Hub Projects - this defines
5
7
  * how the schema properties should be rendered in the
6
8
  * project editing experience
7
9
  */
8
- export declare const uiSchema: IUiSchema;
10
+ export declare const buildUiSchema: (i18nScope: string, entity: IHubSite, context: IArcGISContext) => Promise<IUiSchema>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esri/hub-common",
3
- "version": "14.9.1",
3
+ "version": "14.10.0",
4
4
  "description": "Common TypeScript types and utility functions for @esri/hub.js.",
5
5
  "main": "dist/node/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -1,94 +0,0 @@
1
- import { interpolate } from "../../items";
2
- import { cloneObject } from "../../util";
3
- import { applyUiSchemaElementOptions } from "./internal/applyUiSchemaElementOptions";
4
- import { filterSchemaToUiSchema } from "./internal/filterSchemaToUiSchema";
5
- /**
6
- * DEPRECATED: please use getEditorConfig instead
7
- * get the editor schema and uiSchema defined for an entity.
8
- * The schema and uiSchema that are returned can be used to
9
- * render a form UI (using the configuration editor)
10
- *
11
- * @param i18nScope translation scope to be interpolated into the uiSchema
12
- * @param type editor type - corresonds to the returned uiSchema
13
- * @param options optional hash of dynamic uiSchema element options
14
- * @returns
15
- */
16
- export const getEntityEditorSchemas = async (i18nScope, type, options = []) => {
17
- const entityType = type.split(":")[1];
18
- /* tslint:disable no-console */
19
- // TODO: Remove at breaking change
20
- console.warn(`getEntityEditorSchemas is DEPRECATED. Please use getEditorConfig instead.`);
21
- // schema and uiSchema are dynamically imported based on
22
- // the entity type and the provided editor type
23
- let schema;
24
- let uiSchema;
25
- switch (entityType) {
26
- case "project":
27
- const { ProjectSchema } = await import("../../projects/_internal/ProjectSchema");
28
- schema = cloneObject(ProjectSchema);
29
- ({ uiSchema } = await {
30
- "hub:project:edit": () => import("../../projects/_internal/ProjectUiSchemaEdit"),
31
- "hub:project:create": () => import("../../projects/_internal/ProjectUiSchemaCreate"),
32
- }[type]());
33
- break;
34
- case "initiative":
35
- const { InitiativeSchema } = await import("../../initiatives/_internal/InitiativeSchema");
36
- schema = cloneObject(InitiativeSchema);
37
- ({ uiSchema } = await {
38
- "hub:initiative:edit": () => import("../../initiatives/_internal/InitiativeUiSchemaEdit"),
39
- "hub:initiative:create": () => import("../../initiatives/_internal/InitiativeUiSchemaCreate"),
40
- }[type]());
41
- break;
42
- case "site":
43
- const { SiteSchema } = await import("../../sites/_internal/SiteSchema");
44
- schema = cloneObject(SiteSchema);
45
- ({ uiSchema } = await {
46
- "hub:site:edit": () => import("../../sites/_internal/SiteUiSchemaEdit"),
47
- }[type]());
48
- break;
49
- case "discussion":
50
- const { DiscussionSchema } = await import("../../discussions/_internal/DiscussionSchema");
51
- schema = cloneObject(DiscussionSchema);
52
- ({ uiSchema } = await {
53
- "hub:discussion:edit": () => import("../../discussions/_internal/DiscussionUiSchemaEdit"),
54
- "hub:discussion:create": () => import("../../discussions/_internal/DiscussionUiSchemaCreate"),
55
- }[type]());
56
- break;
57
- case "page":
58
- const { PageSchema } = await import("../../pages/_internal/PageSchema");
59
- schema = cloneObject(PageSchema);
60
- ({ uiSchema } = await {
61
- "hub:page:edit": () => import("../../pages/_internal/PageUiSchemaEdit"),
62
- }[type]());
63
- break;
64
- case "content":
65
- const { ContentSchema } = await import("../../content/_internal/ContentSchema");
66
- schema = cloneObject(ContentSchema);
67
- ({ uiSchema } = await {
68
- "hub:content:edit": () => import("../../content/_internal/ContentUiSchemaEdit"),
69
- }[type]());
70
- break;
71
- case "group":
72
- const { GroupSchema } = await import("../../groups/_internal/GroupSchema");
73
- schema = cloneObject(GroupSchema);
74
- ({ uiSchema } = await {
75
- "hub:group:edit": () => import("../../groups/_internal/GroupUiSchemaEdit"),
76
- "hub:group:settings": () => import("../../groups/_internal/GroupUiSchemaSettings"),
77
- }[type]());
78
- break;
79
- }
80
- // filter out properties not used in the UI schema
81
- schema = filterSchemaToUiSchema(schema, uiSchema);
82
- // apply the options
83
- uiSchema = applyUiSchemaElementOptions(uiSchema, options);
84
- // interpolate the i18n scope into the uiSchema
85
- uiSchema = interpolate(uiSchema, { i18nScope },
86
- // We don't have a real i18n object here, so just return the key
87
- {
88
- translate(i18nKey) {
89
- return `{{${i18nKey}:translate}}`;
90
- },
91
- });
92
- return Promise.resolve({ schema, uiSchema });
93
- };
94
- //# sourceMappingURL=getEntityEditorSchemas.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getEntityEditorSchemas.js","sourceRoot":"","sources":["../../../../src/core/schemas/getEntityEditorSchemas.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AAGzC,OAAO,EAAE,2BAA2B,EAAE,MAAM,wCAAwC,CAAC;AACrF,OAAO,EAAE,sBAAsB,EAAE,MAAM,mCAAmC,CAAC;AAS3E;;;;;;;;;;GAUG;AACH,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,EACzC,SAAiB,EACjB,IAAgB,EAChB,UAAoC,EAAE,EACd,EAAE;IAC1B,MAAM,UAAU,GAAG,IAAI,CAAC,KAAK,CA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AE,GAAG,EAAE,CACrB,MAAM,CAAC,0CAA0C,CAAC;gBACpD,oBAAoB,EAAE,GAAG,EAAE,CACzB,MAAM,CAAC,8CAA8C,CAAC;aACzD,CAAC,IAAuB,CAAC,EAAE,CAAC,CAAC;YAC9B,MAAM;KACT;IAED,kDAAkD;IAClD,MAAM,GAAG,sBAAsB,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;IAClD,oBAAoB;IACpB,QAAQ,GAAG,2BAA2B,CAAC,QAAQ,EAAE,OAAO,CAAC,CAAC;IAC1D,+CAA+C;IAC/C,QAAQ,GAAG,WAAW,CACpB,QAAQ,EACR,EAAE,SAAS,EAAE;IACb,gEAAgE;IAChE;QACE,SAAS,CAAC,OAAe;YACvB,OAAO,KAAK,OAAO,cAAc,CAAC;QACpC,CAAC;KACF,CACF,CAAC;IAEF,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,MAAM,EAAE,QAAQ,EAAE,CAAC,CAAC;AAC/C,CAAC,CAAC"}
@@ -1,31 +0,0 @@
1
- import { deepFind } from "../../../objects/deepFind";
2
- import { cloneObject } from "../../../util";
3
- /**
4
- * Apply a set of run-time configurations into the UI schema so
5
- * the controls can be configured for the current environment.
6
- * TODO: Add Example
7
- * @param schema
8
- * @param options
9
- * @returns
10
- */
11
- export function applyUiSchemaElementOptions(schema, options = []) {
12
- // return a clone so we don't mutate the passed in schema
13
- const cloneSchema = cloneObject(schema);
14
- // merge the options into the uiSchema
15
- // hoist into applyElementOptions fn
16
- options.forEach((elementOptions) => {
17
- // find the entry in the uiSchema for the elementOptions.scope,
18
- // and extend the elementOptions.options into the .options property
19
- const elConfig = deepFind(cloneSchema, (entry) => {
20
- // we dont want to apply this to rules
21
- // Note: If this logic becomes more complex, we may need to
22
- // write a function that's more specific to the uiSchema
23
- return !(entry === null || entry === void 0 ? void 0 : entry.schema) && (entry === null || entry === void 0 ? void 0 : entry.scope) === elementOptions.scope;
24
- });
25
- if (elConfig) {
26
- elConfig.options = Object.assign(Object.assign({}, (elConfig.options || {})), elementOptions.options);
27
- }
28
- });
29
- return cloneSchema;
30
- }
31
- //# sourceMappingURL=applyUiSchemaElementOptions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"applyUiSchemaElementOptions.js","sourceRoot":"","sources":["../../../../../src/core/schemas/internal/applyUiSchemaElementOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAG5C;;;;;;;GAOG;AACH,MAAM,UAAU,2BAA2B,CACzC,MAAiB,EACjB,UAAoC,EAAE;IAEtC,yDAAyD;IACzD,MAAM,WAAW,GAAG,WAAW,CAAC,MAAM,CAAC,CAAC;IACxC,sCAAsC;IACtC,oCAAoC;IACpC,OAAO,CAAC,OAAO,CAAC,CAAC,cAAc,EAAE,EAAE;QACjC,+DAA+D;QAC/D,mEAAmE;QACnE,MAAM,QAAQ,GAAG,QAAQ,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,EAAE;YAC/C,sCAAsC;YACtC,2DAA2D;YAC3D,wDAAwD;YACxD,OAAO,EAAC,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,MAAM,CAAA,IAAI,CAAA,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,KAAK,MAAK,cAAc,CAAC,KAAK,CAAC;QACjE,CAAC,CAAC,CAAC;QACH,IAAI,QAAQ,EAAE;YACZ,QAAQ,CAAC,OAAO,mCACX,CAAC,QAAQ,CAAC,OAAO,IAAI,EAAE,CAAC,GACxB,cAAc,CAAC,OAAO,CAC1B,CAAC;SACH;IACH,CAAC,CAAC,CAAC;IACH,OAAO,WAAW,CAAC;AACrB,CAAC"}
@@ -1,98 +0,0 @@
1
- import { checkPermission } from "../../../permissions/checkPermission";
2
- import { getCategoryItems } from "./getCategoryItems";
3
- import { getLocationExtent } from "./getLocationExtent";
4
- import { getLocationOptions } from "./getLocationOptions";
5
- import { getSharableGroupsComboBoxItems } from "./getSharableGroupsComboBoxItems";
6
- import { getTagItems } from "./getTagItems";
7
- import { getFeaturedImageUrl } from "./getFeaturedImageUrl";
8
- import { getFeaturedContentCatalogs } from "./getFeaturedContentCatalogs";
9
- export const configHelpers = {
10
- access: getAccessConfigOptions,
11
- location: getLocationConfigOptions,
12
- tags: getTagConfigOptions,
13
- categories: getCategoryConfigOptions,
14
- groupsToShareTo: getGroupsToShareToConfigOptions,
15
- featuredContentCatalogs: getFeaturedContentCatalogOptions,
16
- featuredImage: getFeaturedImageConfigOptions,
17
- thumbnail: getThumbnailConfigOptions,
18
- membershipAccess: getMembershipAccessConfigOptions,
19
- };
20
- async function getFeaturedContentCatalogOptions(_entity, context) {
21
- return Promise.resolve({
22
- scope: "/properties/view/properties/featuredContentIds",
23
- options: getFeaturedContentCatalogs(context.currentUser),
24
- });
25
- }
26
- async function getAccessConfigOptions(_entity, context) {
27
- return Promise.resolve({
28
- scope: "/properties/access",
29
- options: {
30
- orgName: context.portal.name,
31
- },
32
- });
33
- }
34
- async function getFeaturedImageConfigOptions(entity, context) {
35
- var _a;
36
- return Promise.resolve({
37
- scope: "/properties/view/properties/featuredImage",
38
- options: {
39
- imgSrc: ((_a = entity.view) === null || _a === void 0 ? void 0 : _a.featuredImageUrl) && getFeaturedImageUrl(entity, context),
40
- },
41
- });
42
- }
43
- async function getThumbnailConfigOptions(entity, _context) {
44
- return Promise.resolve({
45
- scope: "/properties/_thumbnail",
46
- options: {
47
- imgSrc: entity.thumbnailUrl,
48
- },
49
- });
50
- }
51
- async function getLocationConfigOptions(entity, context) {
52
- const ext = await getLocationExtent(entity, context.hubRequestOptions);
53
- const opts = await getLocationOptions(entity, context.portal.name, context.hubRequestOptions);
54
- return Promise.resolve({
55
- scope: "/properties/location",
56
- options: {
57
- extent: ext,
58
- options: opts,
59
- },
60
- });
61
- }
62
- // CAUSES ISSUE
63
- async function getTagConfigOptions(entity, context) {
64
- return Promise.resolve({
65
- scope: "/properties/tags",
66
- options: {
67
- items: await getTagItems(entity, context.portal.id, context.hubRequestOptions),
68
- },
69
- });
70
- }
71
- async function getCategoryConfigOptions(_entity, context) {
72
- return Promise.resolve({
73
- scope: "/properties/categories",
74
- options: {
75
- items: await getCategoryItems(context.portal.id, context.hubRequestOptions),
76
- },
77
- });
78
- }
79
- async function getGroupsToShareToConfigOptions(_entity, context) {
80
- const canShare = checkPermission("platform:portal:user:shareToGroup", context);
81
- return Promise.resolve({
82
- scope: "/properties/_groups",
83
- options: {
84
- items: getSharableGroupsComboBoxItems(context.currentUser.groups),
85
- disabled: !canShare,
86
- },
87
- });
88
- }
89
- async function getMembershipAccessConfigOptions(_entity) {
90
- const isEditGroup = _entity.isSharedUpdate;
91
- return Promise.resolve({
92
- scope: "/properties/membershipAccess",
93
- options: {
94
- disabled: [false, false, isEditGroup],
95
- },
96
- });
97
- }
98
- //# sourceMappingURL=configOptionHelpers.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"configOptionHelpers.js","sourceRoot":"","sources":["../../../../../src/core/schemas/internal/configOptionHelpers.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,sCAAsC,CAAC;AAEvE,OAAO,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AACtD,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AACxD,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,8BAA8B,EAAE,MAAM,kCAAkC,CAAC;AAClF,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAmB1E,MAAM,CAAC,MAAM,aAAa,GAAyC;IACjE,MAAM,EAAE,sBAAsB;IAC9B,QAAQ,EAAE,wBAAwB;IAClC,IAAI,EAAE,mBAAmB;IACzB,U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CAAC,cAAc,CAAC;IAC3C,OAAO,OAAO,CAAC,OAAO,CAAC;QACrB,KAAK,EAAE,8BAA8B;QACrC,OAAO,EAAE;YACP,QAAQ,EAAE,CAAC,KAAK,EAAE,KAAK,EAAE,WAAW,CAAC;SACtC;KACF,CAAC,CAAC;AACL,CAAC"}
@@ -1,15 +0,0 @@
1
- import { configHelpers } from "./configOptionHelpers";
2
- /**
3
- * Process the requested configuration options and return the results
4
- * @param options
5
- * @param entity
6
- * @param context
7
- * @returns
8
- */
9
- export async function getConfigOptions(options, entity, context) {
10
- const prms = options.map((option) => {
11
- return configHelpers[option](entity, context);
12
- });
13
- return Promise.all(prms);
14
- }
15
- //# sourceMappingURL=getConfigOptions.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"getConfigOptions.js","sourceRoot":"","sources":["../../../../../src/core/schemas/internal/getConfigOptions.ts"],"names":[],"mappings":"AAGA,OAAO,EAAgB,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAEpE;;;;;;GAMG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CACpC,OAAuB,EACvB,MAA0B,EAC1B,OAAuB;IAEvB,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;QAClC,OAAO,aAAa,CAAC,MAAM,CAAC,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAChD,CAAC,CAAC,CAAC;IACH,OAAO,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC;AAC3B,CAAC"}