@sprucelabs/heartwood-view-controllers 128.1.8 → 128.2.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 (31) hide show
  1. package/build/.spruce/schemas/heartwoodViewControllers/v2021_02_11/feed.schema.js +6 -0
  2. package/build/.spruce/schemas/schemas.types.d.ts +16 -0
  3. package/build/esm/.spruce/schemas/heartwoodViewControllers/v2021_02_11/feed.schema.js +6 -0
  4. package/build/esm/.spruce/schemas/schemas.types.d.ts +16 -0
  5. package/build/esm/schemas/v2021_02_11/cards/card.builder.d.ts +10 -0
  6. package/build/esm/schemas/v2021_02_11/cards/cardBody.builder.d.ts +10 -0
  7. package/build/esm/schemas/v2021_02_11/cards/cardSection.builder.d.ts +10 -0
  8. package/build/esm/schemas/v2021_02_11/dialog.builder.d.ts +10 -0
  9. package/build/esm/schemas/v2021_02_11/feed.builder.d.ts +10 -0
  10. package/build/esm/schemas/v2021_02_11/feed.builder.js +16 -1
  11. package/build/esm/schemas/v2021_02_11/toolBelt.builder.d.ts +10 -0
  12. package/build/esm/tests/utilities/feedAssert.d.ts +2 -1
  13. package/build/esm/tests/utilities/feedAssert.js +4 -0
  14. package/build/esm/types/heartwood.types.d.ts +1 -0
  15. package/build/esm/viewControllers/Feed.vc.d.ts +2 -1
  16. package/build/esm/viewControllers/Feed.vc.js +5 -1
  17. package/build/esm/viewControllers/ViewControllerExporter.js +1 -0
  18. package/build/schemas/v2021_02_11/cards/card.builder.d.ts +10 -0
  19. package/build/schemas/v2021_02_11/cards/cardBody.builder.d.ts +10 -0
  20. package/build/schemas/v2021_02_11/cards/cardSection.builder.d.ts +10 -0
  21. package/build/schemas/v2021_02_11/dialog.builder.d.ts +10 -0
  22. package/build/schemas/v2021_02_11/feed.builder.d.ts +10 -0
  23. package/build/schemas/v2021_02_11/feed.builder.js +16 -0
  24. package/build/schemas/v2021_02_11/toolBelt.builder.d.ts +10 -0
  25. package/build/tests/utilities/feedAssert.d.ts +2 -1
  26. package/build/tests/utilities/feedAssert.js +4 -0
  27. package/build/types/heartwood.types.d.ts +1 -0
  28. package/build/viewControllers/Feed.vc.d.ts +2 -1
  29. package/build/viewControllers/Feed.vc.js +8 -1
  30. package/build/viewControllers/ViewControllerExporter.js +1 -0
  31. package/package.json +1 -1
@@ -20,6 +20,12 @@ const feedSchema = {
20
20
  minArrayLength: 0,
21
21
  options: { schema: feedItem_schema_1.default, }
22
22
  },
23
+ /** . Determines how the feed should handle scrolling. Inline will scroll within the feed area, while Full View delegates scrolling to the entire view. */
24
+ 'scrollMode': {
25
+ type: 'select',
26
+ hint: 'Determines how the feed should handle scrolling. Inline will scroll within the feed area, while Full View delegates scrolling to the entire view.',
27
+ options: { choices: [{ "value": "inline", "label": "Inline Scroll" }, { "value": "fullView", "label": "Full View" }], }
28
+ },
23
29
  /** . */
24
30
  'onSubmitMessage': {
25
31
  type: 'raw',
@@ -7833,6 +7833,8 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
7833
7833
  namespace SpruceSchemas.HeartwoodViewControllers.v2021_02_11 {
7834
7834
  interface Feed {
7835
7835
  'items': SpruceSchemas.Spruce.v2020_07_22.FeedItem[];
7836
+ /** . Determines how the feed should handle scrolling. Inline will scroll within the feed area, while Full View delegates scrolling to the entire view. */
7837
+ 'scrollMode'?: ("inline" | "fullView") | undefined | null;
7836
7838
  'onSubmitMessage'?: (HeartwoodTypes.OnSubmitFeedMessageHandler) | undefined | null;
7837
7839
  'controller'?: (HeartwoodTypes.ViewController<SpruceSchemas.HeartwoodViewControllers.v2021_02_11.Feed>) | undefined | null;
7838
7840
  }
@@ -7853,6 +7855,20 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
7853
7855
  schema: SpruceSchemas.Spruce.v2020_07_22.FeedItemSchema;
7854
7856
  };
7855
7857
  };
7858
+ /** . Determines how the feed should handle scrolling. Inline will scroll within the feed area, while Full View delegates scrolling to the entire view. */
7859
+ 'scrollMode': {
7860
+ type: 'select';
7861
+ hint: 'Determines how the feed should handle scrolling. Inline will scroll within the feed area, while Full View delegates scrolling to the entire view.';
7862
+ options: {
7863
+ choices: [{
7864
+ "value": "inline";
7865
+ "label": "Inline Scroll";
7866
+ }, {
7867
+ "value": "fullView";
7868
+ "label": "Full View";
7869
+ }];
7870
+ };
7871
+ };
7856
7872
  /** . */
7857
7873
  'onSubmitMessage': {
7858
7874
  type: 'raw';
@@ -15,6 +15,12 @@ const feedSchema = {
15
15
  minArrayLength: 0,
16
16
  options: { schema: feedItemSchema_v2020_07_22, }
17
17
  },
18
+ /** . Determines how the feed should handle scrolling. Inline will scroll within the feed area, while Full View delegates scrolling to the entire view. */
19
+ 'scrollMode': {
20
+ type: 'select',
21
+ hint: 'Determines how the feed should handle scrolling. Inline will scroll within the feed area, while Full View delegates scrolling to the entire view.',
22
+ options: { choices: [{ "value": "inline", "label": "Inline Scroll" }, { "value": "fullView", "label": "Full View" }], }
23
+ },
18
24
  /** . */
19
25
  'onSubmitMessage': {
20
26
  type: 'raw',
@@ -7833,6 +7833,8 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
7833
7833
  namespace SpruceSchemas.HeartwoodViewControllers.v2021_02_11 {
7834
7834
  interface Feed {
7835
7835
  'items': SpruceSchemas.Spruce.v2020_07_22.FeedItem[];
7836
+ /** . Determines how the feed should handle scrolling. Inline will scroll within the feed area, while Full View delegates scrolling to the entire view. */
7837
+ 'scrollMode'?: ("inline" | "fullView") | undefined | null;
7836
7838
  'onSubmitMessage'?: (HeartwoodTypes.OnSubmitFeedMessageHandler) | undefined | null;
7837
7839
  'controller'?: (HeartwoodTypes.ViewController<SpruceSchemas.HeartwoodViewControllers.v2021_02_11.Feed>) | undefined | null;
7838
7840
  }
@@ -7853,6 +7855,20 @@ declare module '@sprucelabs/spruce-core-schemas/build/.spruce/schemas/core.schem
7853
7855
  schema: SpruceSchemas.Spruce.v2020_07_22.FeedItemSchema;
7854
7856
  };
7855
7857
  };
7858
+ /** . Determines how the feed should handle scrolling. Inline will scroll within the feed area, while Full View delegates scrolling to the entire view. */
7859
+ 'scrollMode': {
7860
+ type: 'select';
7861
+ hint: 'Determines how the feed should handle scrolling. Inline will scroll within the feed area, while Full View delegates scrolling to the entire view.';
7862
+ options: {
7863
+ choices: [{
7864
+ "value": "inline";
7865
+ "label": "Inline Scroll";
7866
+ }, {
7867
+ "value": "fullView";
7868
+ "label": "Full View";
7869
+ }];
7870
+ };
7871
+ };
7856
7872
  /** . */
7857
7873
  'onSubmitMessage': {
7858
7874
  type: 'raw';
@@ -30059,6 +30059,16 @@ declare const _default: {
30059
30059
  id: string;
30060
30060
  name: string;
30061
30061
  fields: {
30062
+ scrollMode: {
30063
+ type: "select";
30064
+ options: {
30065
+ choices: {
30066
+ value: string;
30067
+ label: string;
30068
+ }[];
30069
+ };
30070
+ hint: string;
30071
+ };
30062
30072
  onSubmitMessage: {
30063
30073
  type: "raw";
30064
30074
  options: {
@@ -22828,6 +22828,16 @@ declare const _default: {
22828
22828
  id: string;
22829
22829
  name: string;
22830
22830
  fields: {
22831
+ scrollMode: {
22832
+ type: "select";
22833
+ options: {
22834
+ choices: {
22835
+ value: string;
22836
+ label: string;
22837
+ }[];
22838
+ };
22839
+ hint: string;
22840
+ };
22831
22841
  onSubmitMessage: {
22832
22842
  type: "raw";
22833
22843
  options: {
@@ -22773,6 +22773,16 @@ declare const _default: {
22773
22773
  id: string;
22774
22774
  name: string;
22775
22775
  fields: {
22776
+ scrollMode: {
22777
+ type: "select";
22778
+ options: {
22779
+ choices: {
22780
+ value: string;
22781
+ label: string;
22782
+ }[];
22783
+ };
22784
+ hint: string;
22785
+ };
22776
22786
  onSubmitMessage: {
22777
22787
  type: "raw";
22778
22788
  options: {
@@ -30101,6 +30101,16 @@ declare const _default: {
30101
30101
  id: string;
30102
30102
  name: string;
30103
30103
  fields: {
30104
+ scrollMode: {
30105
+ type: "select";
30106
+ options: {
30107
+ choices: {
30108
+ value: string;
30109
+ label: string;
30110
+ }[];
30111
+ };
30112
+ hint: string;
30113
+ };
30104
30114
  onSubmitMessage: {
30105
30115
  type: "raw";
30106
30116
  options: {
@@ -2,6 +2,16 @@ declare const _default: {
2
2
  id: string;
3
3
  name: string;
4
4
  fields: {
5
+ scrollMode: {
6
+ type: "select";
7
+ options: {
8
+ choices: {
9
+ value: string;
10
+ label: string;
11
+ }[];
12
+ };
13
+ hint: string;
14
+ };
5
15
  onSubmitMessage: {
6
16
  type: "raw";
7
17
  options: {
@@ -3,7 +3,22 @@ import { feedSchema } from '@sprucelabs/spruce-core-schemas';
3
3
  export default buildSchema({
4
4
  id: 'feed',
5
5
  name: 'Feed',
6
- fields: Object.assign(Object.assign({}, feedSchema.fields), { onSubmitMessage: {
6
+ fields: Object.assign(Object.assign({}, feedSchema.fields), { scrollMode: {
7
+ type: 'select',
8
+ options: {
9
+ choices: [
10
+ {
11
+ value: 'inline',
12
+ label: 'Inline Scroll',
13
+ },
14
+ {
15
+ value: 'fullView',
16
+ label: 'Full View',
17
+ },
18
+ ],
19
+ },
20
+ hint: 'Determines how the feed should handle scrolling. Inline will scroll within the feed area, while Full View delegates scrolling to the entire view.',
21
+ }, onSubmitMessage: {
7
22
  type: 'raw',
8
23
  options: {
9
24
  valueType: 'HeartwoodTypes.OnSubmitFeedMessageHandler',
@@ -30131,6 +30131,16 @@ declare const _default: {
30131
30131
  id: string;
30132
30132
  name: string;
30133
30133
  fields: {
30134
+ scrollMode: {
30135
+ type: "select";
30136
+ options: {
30137
+ choices: {
30138
+ value: string;
30139
+ label: string;
30140
+ }[];
30141
+ };
30142
+ hint: string;
30143
+ };
30134
30144
  onSubmitMessage: {
30135
30145
  type: "raw";
30136
30146
  options: {
@@ -1,6 +1,7 @@
1
- import { Card, ViewController } from '../../types/heartwood.types';
1
+ import { Card, Feed, ScrollMode, ViewController } from '../../types/heartwood.types';
2
2
  import FeedViewController from '../../viewControllers/Feed.vc';
3
3
  declare const feedAssert: {
4
4
  cardRendersFeed(vc: ViewController<Card>): FeedViewController;
5
+ scrollModeEquals(vc: ViewController<Feed>, expected: ScrollMode): void;
5
6
  };
6
7
  export default feedAssert;
@@ -10,5 +10,9 @@ const feedAssert = {
10
10
  assert.isTruthy(feed === null || feed === void 0 ? void 0 : feed.controller, `Your card does not render a feed view!`);
11
11
  return feed.controller;
12
12
  },
13
+ scrollModeEquals(vc, expected) {
14
+ const { scrollMode } = renderUtil.render(vc);
15
+ assert.isEqual(scrollMode, expected, `Expected scroll mode to be "${expected}" but it was "${scrollMode}"`);
16
+ },
13
17
  };
14
18
  export default feedAssert;
@@ -252,6 +252,7 @@ export type FormBuilderPage = SpruceSchemas.HeartwoodViewControllers.v2021_02_11
252
252
  export type Navigation = SpruceSchemas.HeartwoodViewControllers.v2021_02_11.Navigation;
253
253
  export type NavigationButton = SpruceSchemas.HeartwoodViewControllers.v2021_02_11.NavigationButton;
254
254
  export type LayoutWidth = NonNullable<SkillView['width']>;
255
+ export type ScrollMode = NonNullable<Feed['scrollMode']>;
255
256
  export type NavigationItem = NavigationButton | NavigationSpacer | NavigationImage;
256
257
  export interface NavigationSpacer {
257
258
  isSpacer: true;
@@ -1,5 +1,5 @@
1
1
  import { FeedItem } from '@sprucelabs/spruce-core-schemas';
2
- import { Feed, ViewControllerOptions } from '../types/heartwood.types';
2
+ import { Feed, ScrollMode, ViewControllerOptions } from '../types/heartwood.types';
3
3
  import AbstractViewController from './Abstract.vc';
4
4
  export default class FeedViewController extends AbstractViewController<Feed> {
5
5
  private model;
@@ -9,6 +9,7 @@ export default class FeedViewController extends AbstractViewController<Feed> {
9
9
  setItems(items: FeedItem[]): void;
10
10
  getItems(): import("@sprucelabs/spruce-core-schemas").SpruceSchemas.Spruce.v2020_07_22.FeedItem[];
11
11
  private getTotalItems;
12
+ setScrollMode(mode: ScrollMode): void;
12
13
  render(): Feed;
13
14
  }
14
15
  export type FeedViewControllerOptions = Feed;
@@ -4,7 +4,7 @@ import AbstractViewController from './Abstract.vc.js';
4
4
  export default class FeedViewController extends AbstractViewController {
5
5
  constructor(options) {
6
6
  super(options);
7
- this.model = removeUniversalViewOptions(options);
7
+ this.model = Object.assign({ scrollMode: 'fullView' }, removeUniversalViewOptions(options));
8
8
  }
9
9
  addItem(item) {
10
10
  const hasItem = this.model.items.some((i) => i.id === item.id);
@@ -35,6 +35,10 @@ export default class FeedViewController extends AbstractViewController {
35
35
  getTotalItems() {
36
36
  return this.model.items.length;
37
37
  }
38
+ setScrollMode(mode) {
39
+ this.model.scrollMode = mode;
40
+ this.triggerRender();
41
+ }
38
42
  render() {
39
43
  return Object.assign(Object.assign({}, this.model), { controller: this });
40
44
  }
@@ -188,6 +188,7 @@ class ViewControllerExporter {
188
188
  'google-logging-utils': pathUtil.resolve(__dirname, 'noop.js'),
189
189
  dotenv: pathUtil.resolve(__dirname, 'noop.js'),
190
190
  'gcp-metadata': pathUtil.resolve(__dirname, 'noop.js'),
191
+ webpack: pathUtil.resolve(__dirname, 'noop.js'),
191
192
  },
192
193
  },
193
194
  output: {
@@ -30059,6 +30059,16 @@ declare const _default: {
30059
30059
  id: string;
30060
30060
  name: string;
30061
30061
  fields: {
30062
+ scrollMode: {
30063
+ type: "select";
30064
+ options: {
30065
+ choices: {
30066
+ value: string;
30067
+ label: string;
30068
+ }[];
30069
+ };
30070
+ hint: string;
30071
+ };
30062
30072
  onSubmitMessage: {
30063
30073
  type: "raw";
30064
30074
  options: {
@@ -22828,6 +22828,16 @@ declare const _default: {
22828
22828
  id: string;
22829
22829
  name: string;
22830
22830
  fields: {
22831
+ scrollMode: {
22832
+ type: "select";
22833
+ options: {
22834
+ choices: {
22835
+ value: string;
22836
+ label: string;
22837
+ }[];
22838
+ };
22839
+ hint: string;
22840
+ };
22831
22841
  onSubmitMessage: {
22832
22842
  type: "raw";
22833
22843
  options: {
@@ -22773,6 +22773,16 @@ declare const _default: {
22773
22773
  id: string;
22774
22774
  name: string;
22775
22775
  fields: {
22776
+ scrollMode: {
22777
+ type: "select";
22778
+ options: {
22779
+ choices: {
22780
+ value: string;
22781
+ label: string;
22782
+ }[];
22783
+ };
22784
+ hint: string;
22785
+ };
22776
22786
  onSubmitMessage: {
22777
22787
  type: "raw";
22778
22788
  options: {
@@ -30101,6 +30101,16 @@ declare const _default: {
30101
30101
  id: string;
30102
30102
  name: string;
30103
30103
  fields: {
30104
+ scrollMode: {
30105
+ type: "select";
30106
+ options: {
30107
+ choices: {
30108
+ value: string;
30109
+ label: string;
30110
+ }[];
30111
+ };
30112
+ hint: string;
30113
+ };
30104
30114
  onSubmitMessage: {
30105
30115
  type: "raw";
30106
30116
  options: {
@@ -2,6 +2,16 @@ declare const _default: {
2
2
  id: string;
3
3
  name: string;
4
4
  fields: {
5
+ scrollMode: {
6
+ type: "select";
7
+ options: {
8
+ choices: {
9
+ value: string;
10
+ label: string;
11
+ }[];
12
+ };
13
+ hint: string;
14
+ };
5
15
  onSubmitMessage: {
6
16
  type: "raw";
7
17
  options: {
@@ -7,6 +7,22 @@ exports.default = (0, schema_1.buildSchema)({
7
7
  name: 'Feed',
8
8
  fields: {
9
9
  ...spruce_core_schemas_1.feedSchema.fields,
10
+ scrollMode: {
11
+ type: 'select',
12
+ options: {
13
+ choices: [
14
+ {
15
+ value: 'inline',
16
+ label: 'Inline Scroll',
17
+ },
18
+ {
19
+ value: 'fullView',
20
+ label: 'Full View',
21
+ },
22
+ ],
23
+ },
24
+ hint: 'Determines how the feed should handle scrolling. Inline will scroll within the feed area, while Full View delegates scrolling to the entire view.',
25
+ },
10
26
  onSubmitMessage: {
11
27
  type: 'raw',
12
28
  options: {
@@ -30131,6 +30131,16 @@ declare const _default: {
30131
30131
  id: string;
30132
30132
  name: string;
30133
30133
  fields: {
30134
+ scrollMode: {
30135
+ type: "select";
30136
+ options: {
30137
+ choices: {
30138
+ value: string;
30139
+ label: string;
30140
+ }[];
30141
+ };
30142
+ hint: string;
30143
+ };
30134
30144
  onSubmitMessage: {
30135
30145
  type: "raw";
30136
30146
  options: {
@@ -1,6 +1,7 @@
1
- import { Card, ViewController } from '../../types/heartwood.types';
1
+ import { Card, Feed, ScrollMode, ViewController } from '../../types/heartwood.types';
2
2
  import FeedViewController from '../../viewControllers/Feed.vc';
3
3
  declare const feedAssert: {
4
4
  cardRendersFeed(vc: ViewController<Card>): FeedViewController;
5
+ scrollModeEquals(vc: ViewController<Feed>, expected: ScrollMode): void;
5
6
  };
6
7
  export default feedAssert;
@@ -15,5 +15,9 @@ const feedAssert = {
15
15
  test_utils_1.assert.isTruthy(feed?.controller, `Your card does not render a feed view!`);
16
16
  return feed.controller;
17
17
  },
18
+ scrollModeEquals(vc, expected) {
19
+ const { scrollMode } = render_utility_1.default.render(vc);
20
+ test_utils_1.assert.isEqual(scrollMode, expected, `Expected scroll mode to be "${expected}" but it was "${scrollMode}"`);
21
+ },
18
22
  };
19
23
  exports.default = feedAssert;
@@ -252,6 +252,7 @@ export type FormBuilderPage = SpruceSchemas.HeartwoodViewControllers.v2021_02_11
252
252
  export type Navigation = SpruceSchemas.HeartwoodViewControllers.v2021_02_11.Navigation;
253
253
  export type NavigationButton = SpruceSchemas.HeartwoodViewControllers.v2021_02_11.NavigationButton;
254
254
  export type LayoutWidth = NonNullable<SkillView['width']>;
255
+ export type ScrollMode = NonNullable<Feed['scrollMode']>;
255
256
  export type NavigationItem = NavigationButton | NavigationSpacer | NavigationImage;
256
257
  export interface NavigationSpacer {
257
258
  isSpacer: true;
@@ -1,5 +1,5 @@
1
1
  import { FeedItem } from '@sprucelabs/spruce-core-schemas';
2
- import { Feed, ViewControllerOptions } from '../types/heartwood.types';
2
+ import { Feed, ScrollMode, ViewControllerOptions } from '../types/heartwood.types';
3
3
  import AbstractViewController from './Abstract.vc';
4
4
  export default class FeedViewController extends AbstractViewController<Feed> {
5
5
  private model;
@@ -9,6 +9,7 @@ export default class FeedViewController extends AbstractViewController<Feed> {
9
9
  setItems(items: FeedItem[]): void;
10
10
  getItems(): import("@sprucelabs/spruce-core-schemas").SpruceSchemas.Spruce.v2020_07_22.FeedItem[];
11
11
  private getTotalItems;
12
+ setScrollMode(mode: ScrollMode): void;
12
13
  render(): Feed;
13
14
  }
14
15
  export type FeedViewControllerOptions = Feed;
@@ -9,7 +9,10 @@ const Abstract_vc_1 = __importDefault(require("./Abstract.vc"));
9
9
  class FeedViewController extends Abstract_vc_1.default {
10
10
  constructor(options) {
11
11
  super(options);
12
- this.model = (0, removeUniversalViewOptions_1.default)(options);
12
+ this.model = {
13
+ scrollMode: 'fullView',
14
+ ...(0, removeUniversalViewOptions_1.default)(options),
15
+ };
13
16
  }
14
17
  addItem(item) {
15
18
  const hasItem = this.model.items.some((i) => i.id === item.id);
@@ -40,6 +43,10 @@ class FeedViewController extends Abstract_vc_1.default {
40
43
  getTotalItems() {
41
44
  return this.model.items.length;
42
45
  }
46
+ setScrollMode(mode) {
47
+ this.model.scrollMode = mode;
48
+ this.triggerRender();
49
+ }
43
50
  render() {
44
51
  return { ...this.model, controller: this };
45
52
  }
@@ -174,6 +174,7 @@ class ViewControllerExporter {
174
174
  'google-logging-utils': path_1.default.resolve(__dirname, 'noop.js'),
175
175
  dotenv: path_1.default.resolve(__dirname, 'noop.js'),
176
176
  'gcp-metadata': path_1.default.resolve(__dirname, 'noop.js'),
177
+ webpack: path_1.default.resolve(__dirname, 'noop.js'),
177
178
  },
178
179
  },
179
180
  output: {
package/package.json CHANGED
@@ -12,7 +12,7 @@
12
12
  "sideEffects": false,
13
13
  "license": "MIT",
14
14
  "description": "All the power of Heartwood in one, convenient package.",
15
- "version": "128.1.8",
15
+ "version": "128.2.0",
16
16
  "skill": {
17
17
  "namespace": "HeartwoodViewControllers",
18
18
  "commandOverrides": {