@esri/hub-common 14.176.0 → 14.177.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.
@@ -0,0 +1,21 @@
1
+ import { normalizeItemType } from "./compose";
2
+ import { setProp } from "../objects/set-prop";
3
+ import { modelToHubEditableContent } from "./modelToHubEditableContent";
4
+ import { cloneObject } from "../util";
5
+ /**
6
+ * composes a Hub content entity from an item and optional enrichments
7
+ * @param item item to compose content from
8
+ * @param requestOptions request options (needed to determine certain urls)
9
+ * @param enrichments enrichments to use during composition
10
+ * @returns content entity
11
+ */
12
+ export const composeHubContent = (item, requestOptions, enrichments) => {
13
+ // we must normalize the underlying item type to account
14
+ // for older items (e.g. sites that are type "Web Mapping
15
+ // Application") before we map the model to a Hub Entity
16
+ const normalizedItem = cloneObject(item);
17
+ const type = normalizeItemType(item);
18
+ setProp("type", type, normalizedItem);
19
+ return modelToHubEditableContent({ item: normalizedItem }, requestOptions, enrichments);
20
+ };
21
+ //# sourceMappingURL=composeHubContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"composeHubContent.js","sourceRoot":"","sources":["../../../src/content/composeHubContent.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAC9C,OAAO,EAAE,yBAAyB,EAAE,MAAM,6BAA6B,CAAC;AACxE,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAItC;;;;;;GAMG;AACH,MAAM,CAAC,MAAM,iBAAiB,GAAG,CAC/B,IAAW,EACX,cAAkC,EAClC,WAA2C,EACtB,EAAE;IACvB,wDAAwD;IACxD,yDAAyD;IACzD,wDAAwD;IACxD,MAAM,cAAc,GAAG,WAAW,CAAC,IAAI,CAAC,CAAC;IACzC,MAAM,IAAI,GAAG,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACrC,OAAO,CAAC,MAAM,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;IAEtC,OAAO,yBAAyB,CAC9B,EAAE,IAAI,EAAE,cAAc,EAAE,EACxB,cAAc,EACd,WAAW,CACZ,CAAC;AACJ,CAAC,CAAC"}
@@ -1,10 +1,10 @@
1
1
  export * from "./compose";
2
2
  export * from "./get-family";
3
- export * from "./compose";
4
3
  export * from "./contentUtils";
5
4
  export * from "./edit";
6
5
  export * from "./fetchContent";
7
6
  export * from "./fetchHubContent";
7
+ export * from "./composeHubContent";
8
8
  export * from "./modelToHubEditableContent";
9
9
  export * from "./get-family";
10
10
  export * from "./HubContent";
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/content/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,WAAW,CAAC;AAC1B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/content/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,cAAc,CAAC;AAC7B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,QAAQ,CAAC;AACvB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,cAAc,CAAC;AAC7B,cAAc,cAAc,CAAC;AAC7B,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,sBAAsB,CAAC;AACrC,cAAc,uBAAuB,CAAC"}
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.composeHubContent = void 0;
4
+ const compose_1 = require("./compose");
5
+ const set_prop_1 = require("../objects/set-prop");
6
+ const modelToHubEditableContent_1 = require("./modelToHubEditableContent");
7
+ const util_1 = require("../util");
8
+ /**
9
+ * composes a Hub content entity from an item and optional enrichments
10
+ * @param item item to compose content from
11
+ * @param requestOptions request options (needed to determine certain urls)
12
+ * @param enrichments enrichments to use during composition
13
+ * @returns content entity
14
+ */
15
+ exports.composeHubContent = (item, requestOptions, enrichments) => {
16
+ // we must normalize the underlying item type to account
17
+ // for older items (e.g. sites that are type "Web Mapping
18
+ // Application") before we map the model to a Hub Entity
19
+ const normalizedItem = util_1.cloneObject(item);
20
+ const type = compose_1.normalizeItemType(item);
21
+ set_prop_1.setProp("type", type, normalizedItem);
22
+ return modelToHubEditableContent_1.modelToHubEditableContent({ item: normalizedItem }, requestOptions, enrichments);
23
+ };
24
+ //# sourceMappingURL=composeHubContent.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"composeHubContent.js","sourceRoot":"","sources":["../../../src/content/composeHubContent.ts"],"names":[],"mappings":";;;AAEA,uCAA8C;AAC9C,kDAA8C;AAC9C,2EAAwE;AACxE,kCAAsC;AAItC;;;;;;GAMG;AACU,QAAA,iBAAiB,GAAG,CAC/B,IAAW,EACX,cAAkC,EAClC,WAA2C,EACtB,EAAE;IACvB,wDAAwD;IACxD,yDAAyD;IACzD,wDAAwD;IACxD,MAAM,cAAc,GAAG,kBAAW,CAAC,IAAI,CAAC,CAAC;IACzC,MAAM,IAAI,GAAG,2BAAiB,CAAC,IAAI,CAAC,CAAC;IACrC,kBAAO,CAAC,MAAM,EAAE,IAAI,EAAE,cAAc,CAAC,CAAC;IAEtC,OAAO,qDAAyB,CAC9B,EAAE,IAAI,EAAE,cAAc,EAAE,EACxB,cAAc,EACd,WAAW,CACZ,CAAC;AACJ,CAAC,CAAC"}
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./compose"), exports);
5
5
  tslib_1.__exportStar(require("./get-family"), exports);
6
- tslib_1.__exportStar(require("./compose"), exports);
7
6
  tslib_1.__exportStar(require("./contentUtils"), exports);
8
7
  tslib_1.__exportStar(require("./edit"), exports);
9
8
  tslib_1.__exportStar(require("./fetchContent"), exports);
10
9
  tslib_1.__exportStar(require("./fetchHubContent"), exports);
10
+ tslib_1.__exportStar(require("./composeHubContent"), exports);
11
11
  tslib_1.__exportStar(require("./modelToHubEditableContent"), exports);
12
12
  tslib_1.__exportStar(require("./get-family"), exports);
13
13
  tslib_1.__exportStar(require("./HubContent"), exports);
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/content/index.ts"],"names":[],"mappings":";;;AAAA,oDAA0B;AAC1B,uDAA6B;AAC7B,oDAA0B;AAC1B,yDAA+B;AAC/B,iDAAuB;AACvB,yDAA+B;AAC/B,4DAAkC;AAClC,sEAA4C;AAC5C,uDAA6B;AAC7B,uDAA6B;AAC7B,mDAAyB;AACzB,kDAAwB;AACxB,kDAAwB;AACxB,+DAAqC;AACrC,gEAAsC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/content/index.ts"],"names":[],"mappings":";;;AAAA,oDAA0B;AAC1B,uDAA6B;AAC7B,yDAA+B;AAC/B,iDAAuB;AACvB,yDAA+B;AAC/B,4DAAkC;AAClC,8DAAoC;AACpC,sEAA4C;AAC5C,uDAA6B;AAC7B,uDAA6B;AAC7B,mDAAyB;AACzB,kDAAwB;AACxB,kDAAwB;AACxB,+DAAqC;AACrC,gEAAsC"}
@@ -0,0 +1,12 @@
1
+ import { IHubEditableContentEnrichments } from "../items/_enrichments";
2
+ import { IHubEditableContent } from "../core/types/IHubEditableContent";
3
+ import { IItem } from "@esri/arcgis-rest-portal";
4
+ import { IHubRequestOptions } from "../types";
5
+ /**
6
+ * composes a Hub content entity from an item and optional enrichments
7
+ * @param item item to compose content from
8
+ * @param requestOptions request options (needed to determine certain urls)
9
+ * @param enrichments enrichments to use during composition
10
+ * @returns content entity
11
+ */
12
+ export declare const composeHubContent: (item: IItem, requestOptions: IHubRequestOptions, enrichments: IHubEditableContentEnrichments) => IHubEditableContent;
@@ -1,10 +1,10 @@
1
1
  export * from "./compose";
2
2
  export * from "./get-family";
3
- export * from "./compose";
4
3
  export * from "./contentUtils";
5
4
  export * from "./edit";
6
5
  export * from "./fetchContent";
7
6
  export * from "./fetchHubContent";
7
+ export * from "./composeHubContent";
8
8
  export * from "./modelToHubEditableContent";
9
9
  export * from "./get-family";
10
10
  export * from "./HubContent";
@@ -54,6 +54,12 @@ export interface IHubEmbedSurvey {
54
54
  kind: EmbedKind.feedback;
55
55
  /** survey123 id */
56
56
  id: string;
57
+ /** whether to show the survey header */
58
+ showHeader?: boolean;
59
+ /** whether to show the survey description */
60
+ showDescription?: boolean;
61
+ /** whether to show the survey footer */
62
+ showFooter?: boolean;
57
63
  /** embed height */
58
64
  height?: number;
59
65
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@esri/hub-common",
3
- "version": "14.176.0",
3
+ "version": "14.177.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",