coveragebook_components 0.9.1 → 0.10.1.beta.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (153) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/build/coco/app.css +4433 -3098
  3. data/app/assets/build/coco/app.js +125 -109
  4. data/app/assets/build/coco/book.css +1492 -99
  5. data/app/assets/build/coco/book.js +279 -18
  6. data/app/assets/css/app/tippy.css +1 -1
  7. data/app/assets/css/app.css +3 -3
  8. data/app/assets/css/{base/base.css → base.css} +14 -6
  9. data/app/assets/css/book.css +2 -2
  10. data/app/assets/css/{libs → shared}/tippy.css +20 -1
  11. data/app/assets/css/shared/utils/text.css +143 -0
  12. data/app/assets/js/app.js +2 -2
  13. data/app/assets/js/book.js +2 -2
  14. data/app/assets/js/libs/alpine/directives/dropdown.js +1 -1
  15. data/app/assets/js/libs/alpine/directives/tooltip.js +1 -1
  16. data/app/assets/js/shared/components.js +4 -0
  17. data/app/components/coco/app/blocks/header/header.js +1 -1
  18. data/app/components/coco/app/blocks/header/header.rb +2 -2
  19. data/app/components/coco/app/blocks/nav_drawer/nav_drawer.css +4 -0
  20. data/app/components/coco/app/blocks/nav_drawer/nav_drawer.js +1 -1
  21. data/app/components/coco/app/blocks/sidebar_nav/item/item.css +3 -3
  22. data/app/components/coco/app/blocks/sidebar_nav/item/item.js +2 -2
  23. data/app/components/coco/app/blocks/sidebar_nav/menu/menu.css +3 -3
  24. data/app/components/coco/app/blocks/sidebar_nav/menu/menu.js +1 -1
  25. data/app/components/coco/app/blocks/sidebar_nav/navbar/navbar.js +1 -1
  26. data/app/components/coco/app/blocks/slide_editor/slide_editor.js +1 -1
  27. data/app/components/coco/app/elements/alert/alert.css +18 -50
  28. data/app/components/coco/app/elements/alert/alert.html.erb +2 -2
  29. data/app/components/coco/app/elements/alert/alert.js +1 -1
  30. data/app/components/coco/app/elements/alert/alert.rb +11 -16
  31. data/app/components/coco/app/elements/color_picker/color_picker.css +2 -2
  32. data/app/components/coco/app/elements/color_picker/color_picker.js +1 -1
  33. data/app/components/coco/app/elements/color_picker_button/color_picker_button.js +1 -1
  34. data/app/components/coco/app/elements/color_picker_button/color_picker_button.rb +3 -3
  35. data/app/components/coco/app/elements/confirm_panel/confirm_panel.css +1 -1
  36. data/app/components/coco/app/elements/confirm_panel/confirm_panel.js +1 -1
  37. data/app/components/coco/app/elements/image_picker/image_picker.css +4 -4
  38. data/app/components/coco/app/elements/image_picker/image_picker.js +1 -1
  39. data/app/components/coco/app/elements/image_picker_button/image_picker_button.js +1 -1
  40. data/app/components/coco/app/elements/image_picker_button/image_picker_button.rb +3 -3
  41. data/app/components/coco/app/elements/layout_picker_button/layout_picker_button.js +1 -1
  42. data/app/components/coco/app/elements/layout_picker_button/layout_picker_button.rb +3 -3
  43. data/app/components/coco/app/elements/link/link.rb +1 -1
  44. data/app/components/coco/app/elements/menu/menu.css +5 -5
  45. data/app/components/coco/app/elements/menu_button/menu_button.js +1 -1
  46. data/app/components/coco/app/elements/menu_button/menu_button.rb +3 -3
  47. data/app/components/coco/app/elements/menu_items/user_profile/user_profile.css +1 -1
  48. data/app/components/coco/app/elements/notice/notice.js +1 -1
  49. data/app/components/coco/app/elements/seamless_textarea/seamless_textarea.js +1 -1
  50. data/app/components/coco/app/elements/snackbar/snackbar.css +1 -1
  51. data/app/components/coco/app/elements/snackbar/snackbar.js +1 -1
  52. data/app/components/coco/app/elements/stamp/stamp.css +103 -0
  53. data/app/components/coco/app/elements/stamp/stamp.html.erb +3 -0
  54. data/app/components/coco/app/elements/stamp/stamp.rb +29 -0
  55. data/app/components/coco/app/elements/system_banner/system_banner.js +1 -1
  56. data/app/components/coco/app/elements/toast/toast.js +1 -1
  57. data/app/components/coco/app/elements/toolbar/toolbar.js +1 -1
  58. data/app/components/coco/app/elements/toolbar/toolbar.rb +1 -1
  59. data/app/components/coco/app/fields/button_component.rb +1 -1
  60. data/app/components/coco/app/fields/submit_component.rb +1 -0
  61. data/app/components/coco/app/layouts/application/application.css +1 -1
  62. data/app/components/coco/app/layouts/application/application.js +1 -1
  63. data/app/components/coco/app/layouts/page/page.css +4 -0
  64. data/app/components/coco/app/layouts/page/page.html.erb +5 -0
  65. data/app/components/coco/app/layouts/page/page.js +1 -1
  66. data/app/components/coco/app/layouts/page/page.rb +4 -0
  67. data/app/components/coco/{app/elements → shared}/button/button.css +104 -32
  68. data/app/components/coco/shared/button/button.html.erb +83 -0
  69. data/app/components/coco/{base → shared}/button/button.js +2 -1
  70. data/app/components/coco/{base → shared}/button/button.rb +107 -42
  71. data/app/components/coco/{base → shared}/button/button_dropdown.js +11 -2
  72. data/app/components/coco/{app/elements → shared}/button_group/button_group.css +1 -1
  73. data/app/components/coco/{app/elements → shared}/button_group/button_group.js +12 -4
  74. data/app/components/coco/shared/button_group/button_group.rb +40 -0
  75. data/app/components/coco/{app/elements → shared}/button_to/button_to.css +1 -1
  76. data/app/components/coco/shared/button_to/button_to.rb +50 -0
  77. data/app/components/coco/{base → shared}/dropdown/dropdown.js +1 -1
  78. data/app/components/coco/{base → shared}/icon/icon.js +1 -1
  79. data/app/components/coco/{base → shared}/image_uploader/image_uploader.js +1 -1
  80. data/app/components/coco/{base → shared}/modal/modal.html.erb +2 -2
  81. data/app/components/coco/{base → shared}/modal/modal.js +3 -3
  82. data/app/components/coco/{base → shared}/modal/modal.rb +6 -4
  83. data/app/components/coco/{base → shared}/modal_dialog/modal_dialog.js +1 -1
  84. data/app/components/coco/{base → shared}/modal_lightbox/modal_lightbox.js +1 -1
  85. data/app/components/coco/{base → shared}/placeholder/placeholder.html.erb +1 -1
  86. data/app/components/coco/{base → shared}/placeholder/placeholder.rb +6 -0
  87. data/app/components/coco/{base → shared}/poll_controller/poll_controller.js +1 -1
  88. data/app/helpers/coco/app_helper.rb +17 -23
  89. data/app/helpers/coco/component_helper.rb +1 -1
  90. data/app/helpers/coco/{base_helper.rb → shared_helper.rb} +26 -3
  91. data/app/helpers/coco/url_helper.rb +1 -1
  92. data/config/tailwind.app.config.cjs +1 -1
  93. data/config/tailwind.book.config.cjs +1 -0
  94. data/config/tokens.cjs +9 -4
  95. data/lib/coco/engine.rb +6 -4
  96. data/lib/coco.rb +1 -1
  97. data/lib/generators/coco/coco_generator.rb +1 -1
  98. metadata +77 -80
  99. data/app/assets/css/base/components/coco.css +0 -14
  100. data/app/assets/css/base/components/dropdown.css +0 -7
  101. data/app/assets/css/base/components/tooltip.css +0 -19
  102. data/app/assets/js/base/components.js +0 -4
  103. data/app/components/coco/app/blocks/slat/slat.css +0 -9
  104. data/app/components/coco/app/blocks/slat/slat.rb +0 -13
  105. data/app/components/coco/app/elements/button/button.rb +0 -87
  106. data/app/components/coco/app/elements/button_group/button_group.rb +0 -42
  107. data/app/components/coco/app/elements/button_to/button_to.rb +0 -54
  108. data/app/components/coco/base/button/button.css +0 -75
  109. data/app/components/coco/base/button/button.html.erb +0 -71
  110. /data/app/assets/css/app/{utilities.css → utils.css} +0 -0
  111. /data/app/assets/css/{base → shared}/utils/colors.css +0 -0
  112. /data/app/assets/css/{base → shared}/utils/icons.css +0 -0
  113. /data/app/assets/js/{coco.js → shared/coco.js} +0 -0
  114. /data/app/components/coco/{base → shared}/avatar/avatar.css +0 -0
  115. /data/app/components/coco/{base → shared}/avatar/avatar.rb +0 -0
  116. /data/app/components/coco/{app/elements → shared}/button_group/button_group.html.erb +0 -0
  117. /data/app/components/coco/{app/elements → shared}/button_to/button_to.html.erb +0 -0
  118. /data/app/components/coco/{base → shared}/content/content.rb +0 -0
  119. /data/app/components/coco/{base → shared}/dropdown/dropdown.css +0 -0
  120. /data/app/components/coco/{base → shared}/dropdown/dropdown.html.erb +0 -0
  121. /data/app/components/coco/{base → shared}/dropdown/dropdown.rb +0 -0
  122. /data/app/components/coco/{base → shared}/embeds/youtube/youtube.css +0 -0
  123. /data/app/components/coco/{base → shared}/embeds/youtube/youtube.html.erb +0 -0
  124. /data/app/components/coco/{base → shared}/embeds/youtube/youtube.rb +0 -0
  125. /data/app/components/coco/{base → shared}/icon/icon.css +0 -0
  126. /data/app/components/coco/{base → shared}/icon/icon.html.erb +0 -0
  127. /data/app/components/coco/{base → shared}/icon/icon.rb +0 -0
  128. /data/app/components/coco/{base → shared}/image/image.css +0 -0
  129. /data/app/components/coco/{base → shared}/image/image.rb +0 -0
  130. /data/app/components/coco/{base → shared}/image_uploader/image_uploader.css +0 -0
  131. /data/app/components/coco/{base → shared}/image_uploader/image_uploader.html.erb +0 -0
  132. /data/app/components/coco/{base → shared}/image_uploader/image_uploader.rb +0 -0
  133. /data/app/components/coco/{base → shared}/link/link.css +0 -0
  134. /data/app/components/coco/{base → shared}/link/link.rb +0 -0
  135. /data/app/components/coco/{base → shared}/modal/modal.css +0 -0
  136. /data/app/components/coco/{base → shared}/modal_dialog/modal_dialog.css +0 -0
  137. /data/app/components/coco/{base → shared}/modal_dialog/modal_dialog.html.erb +0 -0
  138. /data/app/components/coco/{base → shared}/modal_dialog/modal_dialog.rb +0 -0
  139. /data/app/components/coco/{base → shared}/modal_lightbox/modal_lightbox.css +0 -0
  140. /data/app/components/coco/{base → shared}/modal_lightbox/modal_lightbox.html.erb +0 -0
  141. /data/app/components/coco/{base → shared}/modal_lightbox/modal_lightbox.rb +0 -0
  142. /data/app/components/coco/{base → shared}/pager_link/pager_link.css +0 -0
  143. /data/app/components/coco/{base → shared}/pager_link/pager_link.html.erb +0 -0
  144. /data/app/components/coco/{base → shared}/pager_link/pager_link.rb +0 -0
  145. /data/app/components/coco/{base → shared}/panel/panel.css +0 -0
  146. /data/app/components/coco/{base → shared}/panel/panel.html.erb +0 -0
  147. /data/app/components/coco/{base → shared}/panel/panel.rb +0 -0
  148. /data/app/components/coco/{base → shared}/placeholder/placeholder.css +0 -0
  149. /data/app/components/coco/{base → shared}/poll_controller/poll_controller.css +0 -0
  150. /data/app/components/coco/{base → shared}/poll_controller/poll_controller.html.erb +0 -0
  151. /data/app/components/coco/{base → shared}/poll_controller/poll_controller.rb +0 -0
  152. /data/app/components/coco/{base → shared}/svg/svg.html.erb +0 -0
  153. /data/app/components/coco/{base → shared}/svg/svg.rb +0 -0
@@ -6178,11 +6178,15 @@
6178
6178
  "display-2": ["80px", "84px"],
6179
6179
  "display-3": ["64px", "68px"],
6180
6180
  "display-4": ["48px", "52px"],
6181
- "heading-1": ["48px", "50px"],
6182
- "heading-2": ["36px", "40px"],
6183
- "heading-3": ["30px", "36px"],
6181
+ "relaxed-display-1": ["96px", "104px"],
6182
+ "relaxed-display-2": ["80px", "88px"],
6183
+ "relaxed-display-3": ["64px", "72px"],
6184
+ "relaxed-display-4": ["48px", "56px"],
6185
+ "heading-1": ["40px", "48px"],
6186
+ "heading-2": ["32px", "40px"],
6187
+ "heading-3": ["28px", "36px"],
6184
6188
  "heading-4": ["24px", "30px"],
6185
- "heading-5": ["20px", "25px"],
6189
+ "heading-5": ["20px", "24px"],
6186
6190
  "heading-6": ["16px", "20px"],
6187
6191
  "subheading-1": ["32px", "40px"],
6188
6192
  "subheading-2": ["24px", "32px"],
@@ -14044,7 +14048,7 @@
14044
14048
  var package_default = {
14045
14049
  name: "coveragebook-components",
14046
14050
  type: "module",
14047
- version: "0.9.1",
14051
+ version: "0.10.1-beta.0",
14048
14052
  main: "index.js",
14049
14053
  repository: "git@github.com:coveragebook/coco.git",
14050
14054
  author: "Mark Perkins <mark@coveragebook.com>",
@@ -24041,13 +24045,13 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
24041
24045
  window.addEventListener("resize", setAppHeightProperty);
24042
24046
  setAppHeightProperty();
24043
24047
 
24044
- // ../../components/coco/base/button/button.js
24048
+ // ../../components/coco/shared/button/button.js
24045
24049
  var button_exports = {};
24046
24050
  __export(button_exports, {
24047
24051
  default: () => button_default
24048
24052
  });
24049
24053
 
24050
- // coco.js
24054
+ // shared/coco.js
24051
24055
  function CocoComponent(name, fn3) {
24052
24056
  const func = nameFunction(name, (...args) => {
24053
24057
  const data2 = fn3(...args);
@@ -24065,7 +24069,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
24065
24069
  return func;
24066
24070
  }
24067
24071
 
24068
- // ../../components/coco/base/button/button.js
24072
+ // ../../components/coco/shared/button/button.js
24069
24073
  var import_lodash2 = __toESM(require_lodash(), 1);
24070
24074
  var button_default = CocoComponent("button", (data2 = {}) => {
24071
24075
  return __spreadProps(__spreadValues({
@@ -24199,17 +24203,18 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
24199
24203
  root: {
24200
24204
  "x-options": "options",
24201
24205
  "x-tooltip": "tooltipText",
24202
- "x-effect": "setTooltipText"
24206
+ "x-effect": "setTooltipText",
24207
+ ":disabled": "disabled"
24203
24208
  }
24204
24209
  });
24205
24210
  });
24206
24211
 
24207
- // ../../components/coco/base/button/button_dropdown.js
24212
+ // ../../components/coco/shared/button/button_dropdown.js
24208
24213
  var button_dropdown_exports = {};
24209
24214
  __export(button_dropdown_exports, {
24210
24215
  default: () => button_dropdown_default
24211
24216
  });
24212
- var button_dropdown_default = CocoComponent("buttonDropdown", (data2 = {}) => {
24217
+ var button_dropdown_default = CocoComponent("buttonDropdown", () => {
24213
24218
  return {
24214
24219
  dropdown: null,
24215
24220
  button: null,
@@ -24227,11 +24232,108 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
24227
24232
  if (this.dropdown) {
24228
24233
  this.dropdown.show();
24229
24234
  }
24235
+ },
24236
+ /* bindings */
24237
+ root: {
24238
+ "@dropdown:show": "button.setState('active')",
24239
+ "@dropdown:hide": "button.resetState()",
24240
+ "@confirmation:confirm": "button.approveAndRun($event)",
24241
+ "@confirmation:cancel": "button.cancelConfirmation($event)"
24242
+ }
24243
+ };
24244
+ });
24245
+
24246
+ // ../../components/coco/shared/button_group/button_group.js
24247
+ var button_group_exports = {};
24248
+ __export(button_group_exports, {
24249
+ default: () => button_group_default
24250
+ });
24251
+ var button_group_default = CocoComponent("appButtonGroup", () => {
24252
+ return {
24253
+ options: ["collapsible"],
24254
+ ready: false,
24255
+ containerWidth: 0,
24256
+ contentWidth: 0,
24257
+ collapsed: false,
24258
+ singletonTooltip: null,
24259
+ tooltipInstances: [],
24260
+ get collapsible() {
24261
+ return this.$options.collapsible !== false;
24262
+ },
24263
+ get buttons() {
24264
+ const buttonElements = this.$el.querySelectorAll(
24265
+ "[data-component='button']"
24266
+ );
24267
+ return Array.from(buttonElements).map((el) => getComponent(el));
24268
+ },
24269
+ get parent() {
24270
+ return this.$root.parentElement;
24271
+ },
24272
+ init() {
24273
+ if (this.collapsible) {
24274
+ this.$nextTick(() => {
24275
+ this.onResize();
24276
+ this.createSingletonTooltip();
24277
+ this.ready = true;
24278
+ });
24279
+ } else {
24280
+ this.ready = true;
24281
+ }
24282
+ this.$watch("collapsed", (value) => {
24283
+ this.buttons.forEach((button) => {
24284
+ button.isCollapsed = value;
24285
+ });
24286
+ this.$nextTick(() => this.createSingletonTooltip());
24287
+ });
24288
+ },
24289
+ createSingletonTooltip() {
24290
+ this.destroySingletonTooltip();
24291
+ this.tooltipInstances = this.buttons.map((button) => {
24292
+ if (button.tippyInstance && button.shouldShowTooltip && button.shouldShowTooltip()) {
24293
+ return button.tippyInstance;
24294
+ }
24295
+ }).filter((t3) => t3);
24296
+ this.singletonTooltip = createSingleton(this.tooltipInstances, {
24297
+ theme: "coco-tooltip",
24298
+ delay: 100,
24299
+ moveTransition: "transform 0.1s ease-out"
24300
+ });
24301
+ },
24302
+ destroySingletonTooltip() {
24303
+ if (this.singletonTooltip && this.singletonTooltip.destroy) {
24304
+ this.singletonTooltip.destroy();
24305
+ this.singletonTooltip = null;
24306
+ this.tooltipInstances.forEach((tooltip) => tooltip.destroy());
24307
+ this.tooltipInstances = [];
24308
+ }
24309
+ },
24310
+ onResize() {
24311
+ if (!this.collapsible)
24312
+ return;
24313
+ this.containerWidth = Math.ceil(this.parent.offsetWidth);
24314
+ if (this.collapsed) {
24315
+ if (this.containerWidth > this.contentWidth) {
24316
+ this.collapsed = false;
24317
+ }
24318
+ } else {
24319
+ if (this.containerWidth < this.contentWidth) {
24320
+ this.collapsed = true;
24321
+ } else {
24322
+ const contentWidth = Math.ceil(this.$refs.buttons.scrollWidth);
24323
+ this.contentWidth = contentWidth;
24324
+ }
24325
+ }
24326
+ },
24327
+ destroy() {
24328
+ if (this.singletonTooltip) {
24329
+ this.singletonTooltip.destroy();
24330
+ this.singletonTooltip = null;
24331
+ }
24230
24332
  }
24231
24333
  };
24232
24334
  });
24233
24335
 
24234
- // ../../components/coco/base/dropdown/dropdown.js
24336
+ // ../../components/coco/shared/dropdown/dropdown.js
24235
24337
  var dropdown_exports = {};
24236
24338
  __export(dropdown_exports, {
24237
24339
  default: () => dropdown_default2
@@ -24240,7 +24342,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
24240
24342
  return {};
24241
24343
  });
24242
24344
 
24243
- // ../../components/coco/base/icon/icon.js
24345
+ // ../../components/coco/shared/icon/icon.js
24244
24346
  var icon_exports = {};
24245
24347
  __export(icon_exports, {
24246
24348
  default: () => icon_default
@@ -24266,7 +24368,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
24266
24368
  };
24267
24369
  });
24268
24370
 
24269
- // ../../components/coco/base/image_uploader/image_uploader.js
24371
+ // ../../components/coco/shared/image_uploader/image_uploader.js
24270
24372
  var image_uploader_exports = {};
24271
24373
  __export(image_uploader_exports, {
24272
24374
  default: () => image_uploader_default
@@ -24339,7 +24441,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
24339
24441
  };
24340
24442
  });
24341
24443
 
24342
- // ../../components/coco/base/modal/modal.js
24444
+ // ../../components/coco/shared/modal/modal.js
24343
24445
  var modal_exports = {};
24344
24446
  __export(modal_exports, {
24345
24447
  default: () => modal_default
@@ -24376,7 +24478,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
24376
24478
  this.hide();
24377
24479
  },
24378
24480
  visit(url) {
24379
- navigateTo(url, { frame: this.frame.id });
24481
+ navigateTo(url, { frame: this.frame.id, turbo: true });
24380
24482
  },
24381
24483
  scrollTo(pos) {
24382
24484
  setTimeout(() => {
@@ -24429,7 +24531,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
24429
24531
  };
24430
24532
  });
24431
24533
 
24432
- // ../../components/coco/base/modal_dialog/modal_dialog.js
24534
+ // ../../components/coco/shared/modal_dialog/modal_dialog.js
24433
24535
  var modal_dialog_exports = {};
24434
24536
  __export(modal_dialog_exports, {
24435
24537
  default: () => modal_dialog_default
@@ -24463,7 +24565,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
24463
24565
  };
24464
24566
  });
24465
24567
 
24466
- // ../../components/coco/base/modal_lightbox/modal_lightbox.js
24568
+ // ../../components/coco/shared/modal_lightbox/modal_lightbox.js
24467
24569
  var modal_lightbox_exports = {};
24468
24570
  __export(modal_lightbox_exports, {
24469
24571
  default: () => modal_lightbox_default
@@ -24497,7 +24599,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
24497
24599
  };
24498
24600
  });
24499
24601
 
24500
- // ../../components/coco/base/poll_controller/poll_controller.js
24602
+ // ../../components/coco/shared/poll_controller/poll_controller.js
24501
24603
  var poll_controller_exports = {};
24502
24604
  __export(poll_controller_exports, {
24503
24605
  default: () => poll_controller_default
@@ -24561,11 +24663,11 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
24561
24663
  }
24562
24664
  }
24563
24665
 
24564
- // import-glob:/Users/mark/Code/coveragebook/coco/app/assets/js/base|@baseComponents/**/*.js
24565
- var modules = [button_exports, button_dropdown_exports, dropdown_exports, icon_exports, image_uploader_exports, modal_exports, modal_dialog_exports, modal_lightbox_exports, poll_controller_exports];
24666
+ // import-glob:/Users/mark/Code/coveragebook/coco/app/assets/js/shared|@sharedComponents/**/*.js
24667
+ var modules = [button_exports, button_dropdown_exports, button_group_exports, dropdown_exports, icon_exports, image_uploader_exports, modal_exports, modal_dialog_exports, modal_lightbox_exports, poll_controller_exports];
24566
24668
  var __default = modules;
24567
24669
 
24568
- // base/components.js
24670
+ // shared/components.js
24569
24671
  var components_default = registerComponents(__default);
24570
24672
 
24571
24673
  // import-glob:/Users/mark/Code/coveragebook/coco/app/assets/js/book|@bookComponents/**/*.js
@@ -25082,92 +25184,6 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
25082
25184
  };
25083
25185
  });
25084
25186
 
25085
- // ../../components/coco/app/elements/button_group/button_group.js
25086
- var button_group_exports = {};
25087
- __export(button_group_exports, {
25088
- default: () => button_group_default
25089
- });
25090
- var button_group_default = CocoComponent("appButtonGroup", () => {
25091
- return {
25092
- options: ["collapsible"],
25093
- ready: false,
25094
- containerWidth: 0,
25095
- contentWidth: 0,
25096
- collapsed: false,
25097
- singletonTooltip: null,
25098
- tooltipInstances: [],
25099
- get collapsible() {
25100
- return this.$options.collapsible !== false;
25101
- },
25102
- get buttons() {
25103
- const buttonElements = this.$el.querySelectorAll(
25104
- "[data-component='app-button']"
25105
- );
25106
- return Array.from(buttonElements).map((el) => getComponent(el));
25107
- },
25108
- get parent() {
25109
- return this.$root.parentElement;
25110
- },
25111
- init() {
25112
- if (this.collapsible) {
25113
- this.$nextTick(() => {
25114
- this.onResize();
25115
- this.createSingletonTooltip();
25116
- this.ready = true;
25117
- });
25118
- } else {
25119
- this.ready = true;
25120
- }
25121
- this.$watch("collapsed", (value) => {
25122
- this.buttons.forEach((button) => {
25123
- button.isCollapsed = value;
25124
- });
25125
- this.$nextTick(() => this.createSingletonTooltip());
25126
- });
25127
- },
25128
- createSingletonTooltip() {
25129
- this.destroySingletonTooltip();
25130
- this.tooltipInstances = this.buttons.map((button) => button.shouldShowTooltip() && button.tippyInstance).filter((t3) => t3);
25131
- this.singletonTooltip = createSingleton(this.tooltipInstances, {
25132
- theme: "coco-tooltip",
25133
- delay: 100,
25134
- moveTransition: "transform 0.1s ease-out"
25135
- });
25136
- },
25137
- destroySingletonTooltip() {
25138
- if (this.singletonTooltip && this.singletonTooltip.destroy) {
25139
- this.singletonTooltip.destroy();
25140
- this.singletonTooltip = null;
25141
- this.tooltipInstances.forEach((tooltip) => tooltip.destroy());
25142
- this.tooltipInstances = [];
25143
- }
25144
- },
25145
- onResize() {
25146
- if (!this.collapsible)
25147
- return;
25148
- this.containerWidth = Math.ceil(this.parent.offsetWidth);
25149
- if (this.collapsed) {
25150
- if (this.containerWidth > this.contentWidth) {
25151
- this.collapsed = false;
25152
- }
25153
- } else {
25154
- if (this.containerWidth < this.contentWidth) {
25155
- this.collapsed = true;
25156
- } else {
25157
- const contentWidth = Math.ceil(this.$refs.buttons.scrollWidth);
25158
- this.contentWidth = contentWidth;
25159
- }
25160
- }
25161
- },
25162
- destroy() {
25163
- if (this.singletonTooltip) {
25164
- this.singletonTooltip.destroy();
25165
- this.singletonTooltip = null;
25166
- }
25167
- }
25168
- };
25169
- });
25170
-
25171
25187
  // ../../components/coco/app/elements/color_picker/color_picker.js
25172
25188
  var color_picker_exports = {};
25173
25189
  __export(color_picker_exports, {
@@ -27433,7 +27449,7 @@ ${expression ? 'Expression: "' + expression + '"\n\n' : ""}`, el);
27433
27449
  });
27434
27450
 
27435
27451
  // import-glob:/Users/mark/Code/coveragebook/coco/app/assets/js/app|@appComponents/**/*.js
27436
- var modules3 = [header_exports, nav_drawer_exports, item_exports, menu_exports, navbar_exports, slide_editor_exports, alert_exports, button_group_exports, color_picker_exports, color_picker_button_exports, confirm_panel_exports, image_picker_exports, image_picker_button_exports, layout_picker_button_exports, menu_button_exports, notice_exports, seamless_textarea_exports, snackbar_exports, system_banner_exports, toast_exports, toolbar_exports, application_exports, page_exports];
27452
+ var modules3 = [header_exports, nav_drawer_exports, item_exports, menu_exports, navbar_exports, slide_editor_exports, alert_exports, color_picker_exports, color_picker_button_exports, confirm_panel_exports, image_picker_exports, image_picker_button_exports, layout_picker_button_exports, menu_button_exports, notice_exports, seamless_textarea_exports, snackbar_exports, system_banner_exports, toast_exports, toolbar_exports, application_exports, page_exports];
27437
27453
  var __default3 = modules3;
27438
27454
 
27439
27455
  // app/components.js