coveragebook_components 0.14.0 → 0.16.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/assets/build/coco/app.css +1538 -1603
- data/app/assets/build/coco/app.js +24316 -26709
- data/app/assets/build/coco/book.css +1237 -1301
- data/app/assets/build/coco/book.js +15630 -17590
- data/app/assets/build/coco/coco.css +6908 -0
- data/app/assets/build/coco/coco.js +16547 -0
- data/app/assets/build/coco/tailwind.preset.js +2759 -0
- data/app/assets/css/base/config.css +1 -1
- data/app/assets/css/base/setup.css +0 -11
- data/app/assets/css/base/tippy.css +40 -43
- data/app/assets/css/base/utils/text.css +0 -210
- data/app/assets/css/coco.css +3 -0
- data/app/assets/css/plugins/aspect.js +27 -0
- data/app/assets/css/plugins/colors.js +30 -0
- data/app/assets/css/plugins/icons.js +17 -0
- data/app/assets/css/plugins/layout.js +15 -0
- data/app/assets/css/plugins/text.js +183 -0
- data/app/assets/js/app.js +9 -28
- data/app/assets/js/base/alpine/directives/options.js +1 -1
- data/app/assets/js/base/alpine/index.js +0 -4
- data/app/assets/js/base/components.js +42 -0
- data/app/assets/js/base/polyfills.js +1 -0
- data/app/assets/js/book.js +7 -6
- data/app/assets/js/coco/coco.js +39 -0
- data/app/assets/js/{base/coco.js → coco/component.js} +1 -0
- data/app/assets/js/coco.js +7 -0
- data/app/assets/js/helpers/dom.js +1 -14
- data/app/assets/js/helpers/index.js +7 -0
- data/app/assets/js/helpers/lang.js +15 -1
- data/app/components/coco/app/application_layout/application_layout.html.erb +3 -1
- data/app/components/coco/app/application_layout/application_layout.js +21 -1
- data/app/components/coco/app/header/header.js +1 -1
- data/app/components/coco/app/nav_drawer/nav_drawer.css +2 -2
- data/app/components/coco/app/nav_drawer/nav_drawer.js +1 -1
- data/app/components/coco/app/plan_card/plan_card.css +1 -1
- data/app/components/coco/app/plan_picker/plan_picker.js +1 -1
- data/app/components/coco/app/sidebar_nav/item/item.js +1 -1
- data/app/components/coco/app/sidebar_nav/menu/menu.js +1 -1
- data/app/components/coco/app/sidebar_nav/navbar/navbar.js +2 -2
- data/app/components/coco/app/slide_editor/slide_editor.js +1 -1
- data/app/components/coco/buttons/button/button.css +5 -5
- data/app/components/coco/buttons/button/button.js +2 -2
- data/app/components/coco/buttons/button/button_dropdown.js +1 -1
- data/app/components/coco/buttons/button_group/button_group.css +1 -1
- data/app/components/coco/buttons/button_group/button_group.js +1 -1
- data/app/components/coco/buttons/color_picker_button/color_picker_button.css +1 -1
- data/app/components/coco/buttons/color_picker_button/color_picker_button.js +1 -1
- data/app/components/coco/buttons/confirm_panel/confirm_panel.js +1 -1
- data/app/components/coco/buttons/image_picker_button/image_picker_button.js +1 -1
- data/app/components/coco/buttons/layout_picker_button/layout_picker_button.js +1 -1
- data/app/components/coco/buttons/menu/menu.css +1 -1
- data/app/components/coco/buttons/menu_button/menu_button.js +1 -1
- data/app/components/coco/buttons/menu_items/user_profile/user_profile.css +1 -1
- data/app/components/coco/buttons/toolbar/toolbar.js +1 -1
- data/app/components/coco/images/icon/icon.js +1 -1
- data/app/components/coco/images/image_uploader/image_uploader.js +1 -1
- data/app/components/coco/indicators/badge/badge.css +1 -1
- data/app/components/coco/layout/page/page.js +1 -1
- data/app/components/coco/layout/panel/panel.css +1 -1
- data/app/components/coco/messaging/alert/alert.js +1 -1
- data/app/components/coco/messaging/notice/notice.js +1 -1
- data/app/components/coco/messaging/snackbar/snackbar.js +1 -1
- data/app/components/coco/messaging/system_banner/system_banner.js +1 -1
- data/app/components/coco/messaging/toast/toast.js +1 -1
- data/app/components/coco/modals/modal/modal.css +1 -1
- data/app/components/coco/modals/modal/modal.js +1 -1
- data/app/components/coco/modals/modal_dialog/modal_dialog.css +1 -1
- data/app/components/coco/modals/modal_dialog/modal_dialog.js +1 -1
- data/app/components/coco/modals/modal_lightbox/modal_lightbox.js +1 -1
- data/app/components/coco/pickers/color_picker/color_picker.js +1 -1
- data/app/components/coco/pickers/image_picker/image_picker.js +1 -1
- data/app/components/coco/utilities/dropdown/dropdown.js +1 -1
- data/app/components/coco/utilities/placeholder/placeholder.css +1 -1
- data/app/components/coco/utilities/poll_controller/poll_controller.js +1 -1
- data/app/components/coco/utilities/seamless_textarea/seamless_textarea.js +1 -1
- data/app/helpers/coco/integration_helper.rb +22 -8
- data/config/exports.js +0 -0
- data/config/tailwind.config.js +12 -0
- data/config/{tailwind.config.cjs → tailwind.preset.js} +11 -39
- data/config/{tokens.cjs → tokens.js} +39 -26
- data/lib/coco.rb +1 -1
- data/lib/scripts/{postcss-import-alias-glob.cjs → postcss-import-alias-glob.js} +1 -1
- data/lib/tasks/coco_tasks.rake +4 -1
- metadata +27 -15
- data/app/assets/css/base/utils/colors.css +0 -30
- data/app/assets/css/base/utils/icons.css +0 -16
- data/app/assets/css/base/utils/layout.css +0 -13
- data/app/assets/js/base/setup.js +0 -8
- /data/config/{utils.cjs → utils.js} +0 -0
- /data/lib/scripts/{esbuild-plugin-build-icons.js → esbuild-plugin-build-icons.mjs} +0 -0
- /data/lib/scripts/{esbuild-plugin-clean.js → esbuild-plugin-clean.mjs} +0 -0
- /data/lib/scripts/{esbuild-plugin-import-glob.js → esbuild-plugin-import-glob.mjs} +0 -0
- /data/lib/scripts/{map-aliased-path.js → map-aliased-path.mjs} +0 -0
@@ -0,0 +1,42 @@
|
|
1
|
+
import buttons from "@components/buttons/**/*.js";
|
2
|
+
import embeds from "@components/embeds/**/*.js";
|
3
|
+
import fields from "@components/fields/**/*.js";
|
4
|
+
import images from "@components/images/**/*.js";
|
5
|
+
import indicators from "@components/indicators/**/*.js";
|
6
|
+
import layout from "@components/layout/**/*.js";
|
7
|
+
import messaging from "@components/messaging/**/*.js";
|
8
|
+
import modals from "@components/modals/**/*.js";
|
9
|
+
import navigation from "@components/navigation/**/*.js";
|
10
|
+
import pickers from "@components/pickers/**/*.js";
|
11
|
+
import typography from "@components/typography/**/*.js";
|
12
|
+
import utilities from "@components/utilities/**/*.js";
|
13
|
+
|
14
|
+
export {
|
15
|
+
buttons,
|
16
|
+
embeds,
|
17
|
+
fields,
|
18
|
+
images,
|
19
|
+
indicators,
|
20
|
+
layout,
|
21
|
+
messaging,
|
22
|
+
modals,
|
23
|
+
navigation,
|
24
|
+
pickers,
|
25
|
+
typography,
|
26
|
+
utilities,
|
27
|
+
};
|
28
|
+
|
29
|
+
export default [
|
30
|
+
...buttons,
|
31
|
+
...embeds,
|
32
|
+
...fields,
|
33
|
+
...images,
|
34
|
+
...indicators,
|
35
|
+
...layout,
|
36
|
+
...messaging,
|
37
|
+
...modals,
|
38
|
+
...navigation,
|
39
|
+
...pickers,
|
40
|
+
...typography,
|
41
|
+
...utilities,
|
42
|
+
];
|
@@ -0,0 +1 @@
|
|
1
|
+
import "container-query-polyfill";
|
data/app/assets/js/book.js
CHANGED
@@ -1,8 +1,9 @@
|
|
1
|
-
import
|
2
|
-
import
|
1
|
+
import "./base/polyfills";
|
2
|
+
import Coco from "./coco/coco";
|
3
|
+
import baseComponents from "./base/components";
|
4
|
+
import bookComponents from "@bookComponents/**/*.js";
|
3
5
|
|
4
|
-
|
6
|
+
Coco.registerComponents(baseComponents);
|
7
|
+
Coco.registerComponents(bookComponents);
|
5
8
|
|
6
|
-
|
7
|
-
|
8
|
-
Alpine.start();
|
9
|
+
export default Coco;
|
@@ -0,0 +1,39 @@
|
|
1
|
+
import Alpine from "../base/alpine";
|
2
|
+
import packageJSON from "@/package.json" assert { type: "json" };
|
3
|
+
import { registerComponents } from "@helpers/alpine.js";
|
4
|
+
import CocoComponent from "./component";
|
5
|
+
import * as helpers from "@helpers/index";
|
6
|
+
|
7
|
+
const Coco = {
|
8
|
+
version: packageJSON.version,
|
9
|
+
|
10
|
+
start() {
|
11
|
+
if (this._started) {
|
12
|
+
throw new Error("Coco has already been started!");
|
13
|
+
}
|
14
|
+
|
15
|
+
console.info("Initializing Coco JS", packageJSON.version);
|
16
|
+
|
17
|
+
registerComponents(this._components);
|
18
|
+
|
19
|
+
window.Alpine = Alpine;
|
20
|
+
Alpine.start();
|
21
|
+
},
|
22
|
+
|
23
|
+
registerComponents(components) {
|
24
|
+
this._components.push(...components);
|
25
|
+
},
|
26
|
+
|
27
|
+
component(...args) {
|
28
|
+
return CocoComponent(...args);
|
29
|
+
},
|
30
|
+
|
31
|
+
_components: [],
|
32
|
+
|
33
|
+
_started: false,
|
34
|
+
};
|
35
|
+
|
36
|
+
Coco.Component = CocoComponent;
|
37
|
+
Coco.helpers = helpers;
|
38
|
+
|
39
|
+
export default Coco;
|
@@ -1,18 +1,5 @@
|
|
1
1
|
import { isNumeric } from "@helpers/lang";
|
2
2
|
|
3
|
-
function getHiddenElementDimensions(el, display = "block") {
|
4
|
-
let size;
|
5
|
-
if (el.style.display === "none") {
|
6
|
-
el.style.display = display;
|
7
|
-
size = el.getBoundingClientRect();
|
8
|
-
el.style.display = "none";
|
9
|
-
} else {
|
10
|
-
size = el.getBoundingClientRect();
|
11
|
-
}
|
12
|
-
|
13
|
-
return size;
|
14
|
-
}
|
15
|
-
|
16
3
|
function castAttributeValue(value) {
|
17
4
|
if (value === "false") {
|
18
5
|
return false;
|
@@ -38,4 +25,4 @@ function isNode(o) {
|
|
38
25
|
typeof o.nodeName === "string";
|
39
26
|
}
|
40
27
|
|
41
|
-
export {
|
28
|
+
export { castAttributeValue, isNode };
|
@@ -1,3 +1,8 @@
|
|
1
|
+
import camelCase from "lodash.camelcase";
|
2
|
+
import kebabCase from "lodash.kebabcase";
|
3
|
+
import mapValues from "lodash.mapvalues";
|
4
|
+
import keyBy from "lodash.keyby";
|
5
|
+
|
1
6
|
function nameFunction(name, body) {
|
2
7
|
return {
|
3
8
|
[name](...args) {
|
@@ -43,4 +48,13 @@ function roughSizeOfObject(object) {
|
|
43
48
|
return bytes;
|
44
49
|
}
|
45
50
|
|
46
|
-
export {
|
51
|
+
export {
|
52
|
+
nameFunction,
|
53
|
+
isObject,
|
54
|
+
isNumeric,
|
55
|
+
roughSizeOfObject,
|
56
|
+
camelCase,
|
57
|
+
kebabCase,
|
58
|
+
keyBy,
|
59
|
+
mapValues,
|
60
|
+
};
|
@@ -1,7 +1,9 @@
|
|
1
1
|
<%= render component_tag(
|
2
2
|
x: {
|
3
3
|
data: x_data("appLayout", banner: banner? && banner_content?),
|
4
|
-
":class": "{'with-banner': banner}"
|
4
|
+
":class": "{'with-banner': banner}",
|
5
|
+
"@app:navigate.window": "handleNavigation",
|
6
|
+
"@resize.window": "setAppHeight"
|
5
7
|
},
|
6
8
|
class: {
|
7
9
|
"with-sidebar-nav": sidebar_nav?,
|
@@ -1,4 +1,5 @@
|
|
1
|
-
import { CocoComponent } from "@assets/js/
|
1
|
+
import { CocoComponent } from "@assets/js/coco/component";
|
2
|
+
import { navigateTo } from "@helpers/location";
|
2
3
|
|
3
4
|
export default CocoComponent("appLayout", (opts) => {
|
4
5
|
return {
|
@@ -6,6 +7,25 @@ export default CocoComponent("appLayout", (opts) => {
|
|
6
7
|
|
7
8
|
init() {
|
8
9
|
this.banner = opts.banner;
|
10
|
+
this.setAppHeight();
|
11
|
+
},
|
12
|
+
|
13
|
+
handleNavigation(event) {
|
14
|
+
const url = event.detail.url;
|
15
|
+
if (url) {
|
16
|
+
delete event.detail.url;
|
17
|
+
navigateTo(url, event.detail);
|
18
|
+
}
|
19
|
+
},
|
20
|
+
|
21
|
+
// Update the value of the `--app-height` css variable
|
22
|
+
// when the viewport size changes. To help work around the
|
23
|
+
// issues when using 100vh on mobile safari (https://medium.com/quick-code/100vh-problem-with-ios-safari-92ab23c852a8)
|
24
|
+
setAppHeight() {
|
25
|
+
document.documentElement.style.setProperty(
|
26
|
+
"--app-height",
|
27
|
+
`${window.innerHeight}px`
|
28
|
+
);
|
9
29
|
},
|
10
30
|
|
11
31
|
hideBanner() {
|
@@ -31,11 +31,11 @@
|
|
31
31
|
}
|
32
32
|
|
33
33
|
.nav-drawer-heading {
|
34
|
-
@apply mt-4 mb-2 mx-4 border-b text-content-dark-1/50 border-gray-300 pb-3;
|
34
|
+
@apply mt-4 mb-2 mx-4 border-b text-content-dark-1/50 border-coco-gray-300 pb-3;
|
35
35
|
}
|
36
36
|
|
37
37
|
.nav-drawer-divider {
|
38
|
-
@apply h-0 border-t border-gray-300 my-3;
|
38
|
+
@apply h-0 border-t border-coco-gray-300 my-3;
|
39
39
|
}
|
40
40
|
|
41
41
|
[data-component="notice"] {
|
@@ -154,10 +154,10 @@
|
|
154
154
|
}
|
155
155
|
|
156
156
|
&[data-theme="toolbar-floating"] {
|
157
|
-
@apply bg-white hover:bg-gray-100 active:bg-gray-200 border-gray-300;
|
157
|
+
@apply bg-white hover:bg-coco-gray-100 active:bg-coco-gray-200 border-coco-gray-300;
|
158
158
|
|
159
159
|
&[data-state="active"] {
|
160
|
-
@apply bg-gray-200;
|
160
|
+
@apply bg-coco-gray-200;
|
161
161
|
}
|
162
162
|
}
|
163
163
|
|
@@ -303,18 +303,18 @@
|
|
303
303
|
}
|
304
304
|
|
305
305
|
&[data-theme="neutral-dark"] {
|
306
|
-
@apply bg-background-dark-1 text-content-light-1 hover:bg-gray-700 active:bg-gray-600 antialiased;
|
306
|
+
@apply bg-background-dark-1 text-content-light-1 hover:bg-coco-gray-700 active:bg-coco-gray-600 antialiased;
|
307
307
|
|
308
308
|
&[data-state="loading"] {
|
309
309
|
@apply bg-background-dark-1;
|
310
310
|
}
|
311
311
|
|
312
312
|
&[data-state="active"] {
|
313
|
-
@apply bg-gray-600;
|
313
|
+
@apply bg-coco-gray-600;
|
314
314
|
}
|
315
315
|
|
316
316
|
&[data-disabled="true"] {
|
317
|
-
@apply bg-gray-300;
|
317
|
+
@apply bg-coco-gray-300;
|
318
318
|
}
|
319
319
|
}
|
320
320
|
|
@@ -1,5 +1,5 @@
|
|
1
|
-
import { CocoComponent } from "@assets/js/
|
2
|
-
import { camelCase } from "
|
1
|
+
import { CocoComponent } from "@assets/js/coco/component.js";
|
2
|
+
import { camelCase } from "@helpers/lang";
|
3
3
|
|
4
4
|
export default CocoComponent("button", (data = {}) => {
|
5
5
|
return {
|
@@ -8,7 +8,7 @@
|
|
8
8
|
|
9
9
|
/* Only style Coco panels that are not rendered inside legacy panel components */
|
10
10
|
&:not([data-component="panel"] [data-component="panel"]) {
|
11
|
-
@apply block bg-content-light-1 border border-gray-300 shadow-md rounded-xl;
|
11
|
+
@apply block bg-content-light-1 border border-coco-gray-300 shadow-md rounded-xl;
|
12
12
|
|
13
13
|
.panel-content {
|
14
14
|
@apply block;
|
@@ -9,7 +9,7 @@
|
|
9
9
|
|
10
10
|
.modal-dialog-header {
|
11
11
|
@apply relative flex items-center;
|
12
|
-
@apply px-4 sm:px-8 h-14 sm:h-16 border-b border-gray-300 rounded-t-xl bg-white;
|
12
|
+
@apply px-4 sm:px-8 h-14 sm:h-16 border-b border-coco-gray-300 rounded-t-xl bg-white;
|
13
13
|
}
|
14
14
|
|
15
15
|
.modal-dialog-title {
|