panda_cms 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of panda_cms might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/app/views/panda_cms/shared/_favicons.html.erb +7 -7
- data/app/views/panda_cms/shared/_header.html.erb +1 -4
- data/config/importmap.rb +7 -5
- data/lib/panda_cms/engine.rb +2 -11
- data/lib/panda_cms/version.rb +1 -1
- data/lib/tasks/panda_cms.rake +7 -0
- data/public/panda-cms-assets/{site.webmanifest → favicons/site.webmanifest} +1 -1
- data/public/panda-cms-assets/javascripts/base.js +37 -0
- data/public/panda-cms-assets/javascripts/controllers/menu_controller.js +19 -0
- data/public/panda-cms-assets/javascripts/controllers/rich_text_editor_controller.js +59 -0
- data/public/panda-cms-assets/javascripts/controllers/text_field_update_controller.js +23 -0
- data/public/panda-cms-assets/javascripts/vendor/stimulus-components-rails-nested-form.js +2 -0
- data/public/panda-cms-assets/javascripts/vendor/tailwindcss-stimulus-components.js +2 -0
- metadata +26 -20
- /data/app/javascript/{panda_cms/base.js → base.js} +0 -0
- /data/app/javascript/{panda_cms/controllers → controllers}/menu_controller.js +0 -0
- /data/app/javascript/{panda_cms/controllers → controllers}/rich_text_editor_controller.js +0 -0
- /data/app/javascript/{panda_cms/controllers → controllers}/text_field_update_controller.js +0 -0
- /data/app/javascript/{panda_cms/vendor → vendor}/stimulus-components-rails-nested-form.js +0 -0
- /data/app/javascript/{panda_cms/vendor → vendor}/tailwindcss-stimulus-components.js +0 -0
- /data/public/panda-cms-assets/{android-chrome-192x192.png → favicons/android-chrome-192x192.png} +0 -0
- /data/public/panda-cms-assets/{android-chrome-512x512.png → favicons/android-chrome-512x512.png} +0 -0
- /data/public/panda-cms-assets/{apple-touch-icon.png → favicons/apple-touch-icon.png} +0 -0
- /data/public/panda-cms-assets/{browserconfig.xml → favicons/browserconfig.xml} +0 -0
- /data/public/panda-cms-assets/{favicon-16x16.png → favicons/favicon-16x16.png} +0 -0
- /data/public/panda-cms-assets/{favicon-32x32.png → favicons/favicon-32x32.png} +0 -0
- /data/public/panda-cms-assets/{favicon.ico → favicons/favicon.ico} +0 -0
- /data/public/panda-cms-assets/{mstile-150x150.png → favicons/mstile-150x150.png} +0 -0
- /data/public/panda-cms-assets/{safari-pinned-tab.svg → favicons/safari-pinned-tab.svg} +0 -0
- /data/public/panda-cms-assets/{editable.js → javascripts/embed/editable.js} +0 -0
- /data/public/panda-cms-assets/{stimulus-loading.js → javascripts/vendor/stimulus-loading.js} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bd4c8dc461c657777c1103e80a1a3984f6f51c4846cb7012a3c587e7164a521b
|
4
|
+
data.tar.gz: 43008c6f73118c7fa3a034d0b9f56b13dc6b8821d7fb82a9f8d31a375c1ab7a5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6cd85803eddc16ed05a2c51ad26aef15a30ed141e77e46947be7fdd242a2067bf55fca087b6ca00d285eaf1b39fb39bc9be6741fdee5984b94038aa88d69af06
|
7
|
+
data.tar.gz: 9e1b1981d52de97c6188018c971f71b81a91bf273d0fa242ec8ddfed6cf8c93dbab0d1841e339d803aee7dfdc1008d2657d0312ed2f40d15dd89fcef784fd492
|
@@ -1,9 +1,9 @@
|
|
1
|
-
<link rel="apple-touch-icon" sizes="180x180" href="/panda-cms-assets/apple-touch-icon.png">
|
2
|
-
<link rel="icon" type="image/png" sizes="32x32" href="/panda-cms-assets/favicon-32x32.png">
|
3
|
-
<link rel="icon" type="image/png" sizes="16x16" href="/panda-cms-assets/favicon-16x16.png">
|
4
|
-
<link rel="manifest" href="/panda-cms-assets/site.webmanifest">
|
5
|
-
<link rel="mask-icon" href="/panda-cms-assets/safari-pinned-tab.svg" color="#5bbad5">
|
6
|
-
<link rel="shortcut icon" href="/panda-cms-assets/favicon.ico">
|
1
|
+
<link rel="apple-touch-icon" sizes="180x180" href="/panda-cms-assets/favicons/apple-touch-icon.png">
|
2
|
+
<link rel="icon" type="image/png" sizes="32x32" href="/panda-cms-assets/favicons/favicon-32x32.png">
|
3
|
+
<link rel="icon" type="image/png" sizes="16x16" href="/panda-cms-assets/favicons/favicon-16x16.png">
|
4
|
+
<link rel="manifest" href="/panda-cms-assets/favicons/site.webmanifest">
|
5
|
+
<link rel="mask-icon" href="/panda-cms-assets/favicons/safari-pinned-tab.svg" color="#5bbad5">
|
6
|
+
<link rel="shortcut icon" href="/panda-cms-assets/favicons/favicon.ico">
|
7
7
|
<meta name="msapplication-TileColor" content="#b91d47">
|
8
|
-
<meta name="msapplication-config" content="/panda-cms-assets/browserconfig.xml">
|
8
|
+
<meta name="msapplication-config" content="/panda-cms-assets/favicons/browserconfig.xml">
|
9
9
|
<meta name="theme-color" content="#ffffff">
|
@@ -8,10 +8,7 @@
|
|
8
8
|
<link rel="stylesheet" href="https://use.typekit.net/him4vgh.css">
|
9
9
|
<script async src="https://ga.jspm.io/npm:es-module-shims@1.10.0/dist/es-module-shims.js" crossorigin="anonymous"></script>
|
10
10
|
<%= stylesheet_link_tag "panda_cms", "data-turbo-track": "reload" %>
|
11
|
-
|
12
|
-
<%= raw(PandaCms::Engine.importmap.to_json(resolver: self)) %>
|
13
|
-
</script>
|
14
|
-
<%= javascript_import_module_tag "panda_cms/base" %>
|
11
|
+
<%= javascript_importmap_tags "panda_cms/base" %>
|
15
12
|
<%= render "panda_cms/shared/favicons" %>
|
16
13
|
</head>
|
17
14
|
|
data/config/importmap.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
1
|
pin "@hotwired/stimulus", to: "https://ga.jspm.io/npm:stimulus@3.2.2/dist/stimulus.js"
|
2
|
-
|
3
|
-
pin "@hotwired/stimulus-loading", to: "/panda-cms-assets/stimulus-loading.js" # 3.2.2
|
2
|
+
pin "@hotwired/stimulus-loading", to: "/panda-cms-assets/javascripts/vendor/stimulus-loading.js" # 3.2.2
|
4
3
|
|
5
|
-
|
6
|
-
|
7
|
-
|
4
|
+
pin "panda_cms/vendor/stimulus-components-rails-nested-form", to: "/panda-cms-assets/javascripts/vendor/stimulus-components-rails-nested-form.js", preload: false
|
5
|
+
pin "panda_cms/vendor/tailwindcss-stimulus-components", to: "/panda-cms-assets/javascripts/vendor/tailwindcss-stimulus-components.js", preload: false
|
6
|
+
pin "panda_cms/controllers/menu_controller", to: "/panda-cms-assets/javascripts/controllers/menu_controller.js", preload: false
|
7
|
+
pin "panda_cms/controllers/rich_text_editor_controller", to: "/panda-cms-assets/javascripts/controllers/rich_text_editor_controller.js", preload: false
|
8
|
+
pin "panda_cms/controllers/text_field_update_controller", to: "/panda-cms-assets/javascripts/controllers/text_field_update_controller.js", preload: false
|
9
|
+
pin "panda_cms/base", to: "/panda-cms-assets/javascripts/base.js", preload: false
|
data/lib/panda_cms/engine.rb
CHANGED
@@ -15,8 +15,6 @@ module PandaCms
|
|
15
15
|
isolate_namespace PandaCms
|
16
16
|
engine_name "panda_cms"
|
17
17
|
|
18
|
-
attr_accessor :importmap
|
19
|
-
|
20
18
|
config.to_prepare do
|
21
19
|
ApplicationController.helper(::ApplicationHelper)
|
22
20
|
end
|
@@ -44,15 +42,8 @@ module PandaCms
|
|
44
42
|
|
45
43
|
# Create an importmap for the engine's JS
|
46
44
|
initializer "panda_cms.importmap", before: "importmap" do |app|
|
47
|
-
|
48
|
-
|
49
|
-
map.cache_sweeper(watches: PandaCms::Engine.root.join("app/javascript"))
|
50
|
-
# TODO: Sort in production?
|
51
|
-
app.config.assets.paths << PandaCms::Engine.root.join("app/javascript") if Rails.env.development?
|
52
|
-
PandaCms::Engine.importmap = map
|
53
|
-
ActiveSupport.on_load(:action_controller_base, run_once: true) do
|
54
|
-
before_action { PandaCms::Engine.importmap.cache_sweeper.execute_if_updated }
|
55
|
-
end
|
45
|
+
app.config.importmap.cache_sweeper(watches: PandaCms::Engine.root.join("public/panda-cms-assets"))
|
46
|
+
app.config.importmap.paths << PandaCms::Engine.root.join("config/importmap.rb")
|
56
47
|
end
|
57
48
|
|
58
49
|
# Append routes to the routes file
|
data/lib/panda_cms/version.rb
CHANGED
data/lib/tasks/panda_cms.rake
CHANGED
@@ -5,6 +5,13 @@ ENV["TAILWIND_PATH"] ||= Tailwindcss::Engine.root.join("exe/tailwindcss").to_s
|
|
5
5
|
|
6
6
|
namespace :panda_cms do
|
7
7
|
namespace :assets do
|
8
|
+
desc "Compile assets for release"
|
9
|
+
task :compile do
|
10
|
+
# Copy all the JS files into public
|
11
|
+
admin_js_path = PandaCms::Engine.root.join("app/javascript/panda_cms")
|
12
|
+
FileUtils.cp_r "#{admin_js_path}/.", PandaCms::Engine.root.join("public/panda-cms-assets/javascripts")
|
13
|
+
end
|
14
|
+
|
8
15
|
desc "Build admin assets for Panda CMS"
|
9
16
|
task :admin do
|
10
17
|
run_tailwind(
|
@@ -0,0 +1,37 @@
|
|
1
|
+
import { Application as PandaCmsApplication } from "@hotwired/stimulus";
|
2
|
+
|
3
|
+
const panda_cms = PandaCmsApplication.start();
|
4
|
+
|
5
|
+
// Configure Stimulus development experience
|
6
|
+
panda_cms.debug = location.hostname === "localhost";
|
7
|
+
window.pandaStimulus = panda_cms;
|
8
|
+
|
9
|
+
export { panda_cms };
|
10
|
+
|
11
|
+
// Eager load all controllers defined in the import map under controllers/**/*_controller
|
12
|
+
import { eagerLoadControllersFrom } from "@hotwired/stimulus-loading";
|
13
|
+
eagerLoadControllersFrom("panda_cms/controllers", panda_cms);
|
14
|
+
|
15
|
+
import {
|
16
|
+
Alert,
|
17
|
+
Autosave,
|
18
|
+
ColorPreview,
|
19
|
+
Dropdown,
|
20
|
+
Modal,
|
21
|
+
Tabs,
|
22
|
+
Popover,
|
23
|
+
Toggle,
|
24
|
+
Slideover,
|
25
|
+
} from "panda_cms/vendor/tailwindcss-stimulus-components";
|
26
|
+
panda_cms.register("alert", Alert);
|
27
|
+
panda_cms.register("autosave", Autosave);
|
28
|
+
panda_cms.register("color-preview", ColorPreview);
|
29
|
+
panda_cms.register("dropdown", Dropdown);
|
30
|
+
panda_cms.register("modal", Modal);
|
31
|
+
panda_cms.register("popover", Popover);
|
32
|
+
panda_cms.register("slideover", Slideover);
|
33
|
+
panda_cms.register("tabs", Tabs);
|
34
|
+
panda_cms.register("toggle", Toggle);
|
35
|
+
|
36
|
+
import RailsNestedForm from "panda_cms/vendor/stimulus-components-rails-nested-form";
|
37
|
+
panda_cms.register("nested-form", RailsNestedForm);
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { Controller as PandaCmsController } from "@hotwired/stimulus"
|
2
|
+
|
3
|
+
export default class extends PandaCmsController {
|
4
|
+
static targets = ["pandaCmsMenu"]
|
5
|
+
static values = {
|
6
|
+
open: { type: Boolean, default: false }
|
7
|
+
}
|
8
|
+
|
9
|
+
toggle(event) {
|
10
|
+
this.openValue = !this.openValue
|
11
|
+
this.animate()
|
12
|
+
}
|
13
|
+
|
14
|
+
animate() {
|
15
|
+
this.toggleableTargets.forEach(target => {
|
16
|
+
transition(target, this.openValue)
|
17
|
+
})
|
18
|
+
}
|
19
|
+
}
|
@@ -0,0 +1,59 @@
|
|
1
|
+
import { Controller as PandaCmsController } from "@hotwired/stimulus";
|
2
|
+
|
3
|
+
export default class extends PandaCmsController {
|
4
|
+
static targets = ["container", "hidden", "toolbar", "form"];
|
5
|
+
|
6
|
+
connect() {
|
7
|
+
this.quillInit();
|
8
|
+
}
|
9
|
+
|
10
|
+
/**
|
11
|
+
* Fire up quill wyswig editor
|
12
|
+
*/
|
13
|
+
quillInit() {
|
14
|
+
const quill = new Quill(this.containerTarget, this.quillOption);
|
15
|
+
let _this = this;
|
16
|
+
|
17
|
+
// While we type, copy the text to our hidden form field so it can be saved.
|
18
|
+
quill.on("text-change", function (delta) {
|
19
|
+
_this.hiddenTarget.value = quill.root.innerHTML;
|
20
|
+
});
|
21
|
+
|
22
|
+
// Capture focus on and off events
|
23
|
+
quill.on("selection-change", function (range, oldRange, source) {
|
24
|
+
if (range === null && oldRange !== null) {
|
25
|
+
_this.onFocusOut();
|
26
|
+
} else if (range !== null && oldRange === null) _this.onFocus();
|
27
|
+
});
|
28
|
+
}
|
29
|
+
|
30
|
+
/**
|
31
|
+
* Fires when the editor receives focus
|
32
|
+
*/
|
33
|
+
onFocus() {
|
34
|
+
// Add a border and reveal the toolbar
|
35
|
+
this.element.classList.add("border-gray-200");
|
36
|
+
this.toolbarTarget.classList.add("opacity-100");
|
37
|
+
}
|
38
|
+
|
39
|
+
/**
|
40
|
+
* Fires when the editor loses focus
|
41
|
+
*/
|
42
|
+
onFocusOut() {
|
43
|
+
// Hide the border and toolbar
|
44
|
+
this.element.classList.remove("border-gray-200");
|
45
|
+
this.toolbarTarget.classList.remove("opacity-100");
|
46
|
+
|
47
|
+
// Submit the form to save our updates
|
48
|
+
this.formTarget.requestSubmit();
|
49
|
+
}
|
50
|
+
|
51
|
+
// Quill configuration options
|
52
|
+
get quillOption() {
|
53
|
+
return {
|
54
|
+
modules: {
|
55
|
+
toolbar: this.toolbarTarget,
|
56
|
+
},
|
57
|
+
};
|
58
|
+
}
|
59
|
+
}
|
@@ -0,0 +1,23 @@
|
|
1
|
+
import { Controller as PandaCmsController } from "@hotwired/stimulus"
|
2
|
+
export default class extends PandaCmsController {
|
3
|
+
static targets = [ "existing_root", "input_select", "input_text", "output_text" ]
|
4
|
+
|
5
|
+
connect() {
|
6
|
+
}
|
7
|
+
|
8
|
+
generatePath() {
|
9
|
+
this.output_textTarget.value = "/" + this.createSlug(this.input_textTarget.value);
|
10
|
+
}
|
11
|
+
|
12
|
+
setPrePath() {
|
13
|
+
this.parent_slugs = this.input_selectTarget.options[this.input_selectTarget.selectedIndex].text.match(/.*\((.*)\)$/)[1];
|
14
|
+
this.output_textTarget.previousSibling.innerHTML = (this.existing_rootTarget.value + this.parent_slugs).replace(/\/$/, '');;
|
15
|
+
}
|
16
|
+
|
17
|
+
createSlug(input) {
|
18
|
+
return input.toLowerCase().trim()
|
19
|
+
.replace(/[^\w\s-]/g, "-")
|
20
|
+
.replace(/&/, "and")
|
21
|
+
.replace(/[\s_-]+/g, "-");
|
22
|
+
}
|
23
|
+
}
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import{Controller as e}from"@hotwired/stimulus";const t=class _RailsNestedForm extends e{add(e){e.preventDefault();const t=this.templateTarget.innerHTML.replace(/NEW_RECORD/g,(new Date).getTime().toString());this.targetTarget.insertAdjacentHTML("beforebegin",t);const r=new CustomEvent("rails-nested-form:add",{bubbles:!0});this.element.dispatchEvent(r)}remove(e){e.preventDefault();const t=e.target.closest(this.wrapperSelectorValue);if(t.dataset.newRecord==="true")t.remove();else{t.style.display="none";const e=t.querySelector("input[name*='_destroy']");e.value="1"}const r=new CustomEvent("rails-nested-form:remove",{bubbles:!0});this.element.dispatchEvent(r)}};t.targets=["target","template"],t.values={wrapperSelector:{type:String,default:".nested-form-wrapper"}};let r=t;export{r as default};
|
2
|
+
|
@@ -0,0 +1,2 @@
|
|
1
|
+
import{Controller as e}from"@hotwired/stimulus";var t=Object.defineProperty;var V=(e,a,i)=>a in e?t(e,a,{enumerable:!0,configurable:!0,writable:!0,value:i}):e[a]=i;var s=(e,t,a)=>(V(e,typeof t!="symbol"?t+"":t,a),a);async function r(e,t,a={}){t?T(e,a):b(e,a)}async function T(e,t={}){let a=e.dataset.transitionEnter||t.enter||"enter",i=e.dataset.transitionEnterFrom||t.enterFrom||"enter-from",n=e.dataset.transitionEnterTo||t.enterTo||"enter-to",o=e.dataset.toggleClass||t.toggleClass||"hidden";e.classList.add(...a.split(" ")),e.classList.add(...i.split(" ")),e.classList.remove(...n.split(" ")),e.classList.remove(...o.split(" ")),await v(),e.classList.remove(...i.split(" ")),e.classList.add(...n.split(" "));try{await x(e)}finally{e.classList.remove(...a.split(" "))}}async function b(e,t={}){let a=e.dataset.transitionLeave||t.leave||"leave",i=e.dataset.transitionLeaveFrom||t.leaveFrom||"leave-from",n=e.dataset.transitionLeaveTo||t.leaveTo||"leave-to",o=e.dataset.toggleClass||t.toggle||"hidden";e.classList.add(...a.split(" ")),e.classList.add(...i.split(" ")),e.classList.remove(...n.split(" ")),await v(),e.classList.remove(...i.split(" ")),e.classList.add(...n.split(" "));try{await x(e)}finally{e.classList.remove(...a.split(" ")),e.classList.add(...o.split(" "))}}function v(){return new Promise((e=>{requestAnimationFrame((()=>{requestAnimationFrame(e)}))}))}function x(e){return Promise.all(e.getAnimations().map((e=>e.finished)))}var a=class extends e{connect(){setTimeout((()=>{T(this.element)}),this.showDelayValue),this.hasDismissAfterValue&&setTimeout((()=>{this.close()}),this.dismissAfterValue)}close(){b(this.element).then((()=>{this.element.remove()}))}};s(a,"values",{dismissAfter:Number,showDelay:{type:Number,default:0}});var i=class extends e{connect(){this.timeout=null}save(){clearTimeout(this.timeout),this.timeout=setTimeout((()=>{this.statusTarget.textContent=this.submittingTextValue,this.formTarget.requestSubmit()}),this.submitDurationValue)}success(){this.setStatus(this.successTextValue)}error(){this.setStatus(this.errorTextValue)}setStatus(e){this.statusTarget.textContent=e,this.timeout=setTimeout((()=>{this.statusTarget.textContent=""}),this.statusDurationValue)}};s(i,"targets",["form","status"]),s(i,"values",{submitDuration:{type:Number,default:1e3},statusDuration:{type:Number,default:2e3},submittingText:{type:String,default:"Saving..."},successText:{type:String,default:"Saved!"},errorText:{type:String,default:"Unable to save."}});var n=class extends e{update(){this.preview=this.colorTarget.value}set preview(e){this.previewTarget.style[this.styleValue]=e;let t=this._getContrastYIQ(e);this.styleValue==="color"?this.previewTarget.style.backgroundColor=t:this.previewTarget.style.color=t}_getContrastYIQ(e){e=e.replace("#","");let t=128,a=parseInt(e.substr(0,2),16),i=parseInt(e.substr(2,2),16),n=parseInt(e.substr(4,2),16);return(a*299+i*587+n*114)/1e3>=t?"#000":"#fff"}};s(n,"targets",["preview","color"]),s(n,"values",{style:{type:String,default:"backgroundColor"}});var o=class extends e{connect(){document.addEventListener("turbo:before-cache",this.beforeCache.bind(this))}disconnect(){document.removeEventListener("turbo:before-cache",this.beforeCache.bind(this))}openValueChanged(){r(this.menuTarget,this.openValue,this.transitionOptions),this.openValue===!0&&this.hasMenuItemTarget&&this.menuItemTargets[0].focus()}show(){this.openValue=!0}close(){this.openValue=!1}hide(e){this.closeOnClickOutsideValue&&e.target.nodeType&&this.element.contains(e.target)===!1&&this.openValue&&(this.openValue=!1),this.closeOnEscapeValue&&e.key==="Escape"&&this.openValue&&(this.openValue=!1)}toggle(){this.openValue=!this.openValue}nextItem(e){e.preventDefault(),this.menuItemTargets[this.nextIndex].focus()}previousItem(e){e.preventDefault(),this.menuItemTargets[this.previousIndex].focus()}get currentItemIndex(){return this.menuItemTargets.indexOf(document.activeElement)}get nextIndex(){return Math.min(this.currentItemIndex+1,this.menuItemTargets.length-1)}get previousIndex(){return Math.max(this.currentItemIndex-1,0)}get transitionOptions(){return{enter:this.hasEnterClass?this.enterClass:"transition ease-out duration-100",enterFrom:this.hasEnterFromClass?this.enterFromClass:"transform opacity-0 scale-95",enterTo:this.hasEnterToClass?this.enterToClass:"transform opacity-100 scale-100",leave:this.hasLeaveClass?this.leaveClass:"transition ease-in duration-75",leaveFrom:this.hasLeaveFromClass?this.leaveFromClass:"transform opacity-100 scale-100",leaveTo:this.hasLeaveToClass?this.leaveToClass:"transform opacity-0 scale-95",toggleClass:this.hasToggleClass?this.toggleClass:"hidden"}}beforeCache(){this.openValue=!1,this.menuTarget.classList.add("hidden")}};s(o,"targets",["menu","button","menuItem"]),s(o,"values",{open:{type:Boolean,default:!1},closeOnEscape:{type:Boolean,default:!0},closeOnClickOutside:{type:Boolean,default:!0}}),s(o,"classes",["enter","enterFrom","enterTo","leave","leaveFrom","leaveTo","toggle"]);var l=class extends e{connect(){this.openValue&&this.open(),document.addEventListener("turbo:before-cache",this.beforeCache.bind(this))}disconnect(){document.removeEventListener("turbo:before-cache",this.beforeCache.bind(this))}open(){this.dialogTarget.showModal()}close(){this.dialogTarget.setAttribute("closing",""),Promise.all(this.dialogTarget.getAnimations().map((e=>e.finished))).then((()=>{this.dialogTarget.removeAttribute("closing"),this.dialogTarget.close()}))}backdropClose(e){e.target.nodeName=="DIALOG"&&this.close()}show(){this.dialogTarget.show()}hide(){this.close()}beforeCache(){this.close()}};s(l,"targets",["dialog"]),s(l,"values",{open:Boolean});var h=class extends e{openValueChanged(){r(this.contentTarget,this.openValue),this.shouldAutoDismiss&&this.scheduleDismissal()}show(e){this.shouldAutoDismiss&&this.scheduleDismissal(),this.openValue=!0}hide(){this.openValue=!1}toggle(){this.openValue=!this.openValue}get shouldAutoDismiss(){return this.openValue&&this.hasDismissAfterValue}scheduleDismissal(){this.hasDismissAfterValue&&(this.cancelDismissal(),this.timeoutId=setTimeout((()=>{this.hide(),this.timeoutId=void 0}),this.dismissAfterValue))}cancelDismissal(){typeof this.timeoutId=="number"&&(clearTimeout(this.timeoutId),this.timeoutId=void 0)}};s(h,"targets",["content"]),s(h,"values",{dismissAfter:Number,open:{type:Boolean,default:!1}});var u=class extends e{connect(){this.openValue&&this.open(),document.addEventListener("turbo:before-cache",this.beforeCache.bind(this))}disconnect(){document.removeEventListener("turbo:before-cache",this.beforeCache.bind(this))}open(){this.dialogTarget.showModal()}close(){this.dialogTarget.setAttribute("closing",""),Promise.all(this.dialogTarget.getAnimations().map((e=>e.finished))).then((()=>{this.dialogTarget.removeAttribute("closing"),this.dialogTarget.close()}))}backdropClose(e){e.target.nodeName=="DIALOG"&&this.close()}show(){this.open()}hide(){this.close()}beforeCache(){this.close()}};s(u,"targets",["dialog"]),s(u,"values",{open:Boolean});var c=class extends e{initialize(){this.anchor&&(this.indexValue=this.tabTargets.findIndex((e=>e.id===this.anchor)))}connect(){this.showTab()}change(e){e.currentTarget.tagName==="SELECT"?this.indexValue=e.currentTarget.selectedIndex:e.currentTarget.dataset.index?this.indexValue=e.currentTarget.dataset.index:e.currentTarget.dataset.id?this.indexValue=this.tabTargets.findIndex((t=>t.id==e.currentTarget.dataset.id)):this.indexValue=this.tabTargets.indexOf(e.currentTarget)}nextTab(){this.indexValue=Math.min(this.indexValue+1,this.tabsCount-1)}previousTab(){this.indexValue=Math.max(this.indexValue-1,0)}firstTab(){this.indexValue=0}lastTab(){this.indexValue=this.tabsCount-1}indexValueChanged(){if(this.showTab(),this.dispatch("tab-change",{target:this.tabTargets[this.indexValue],detail:{activeIndex:this.indexValue}}),this.updateAnchorValue){let e=this.tabTargets[this.indexValue].id;if(this.scrollToAnchorValue)location.hash=e;else{let t=window.location.href.split("#")[0]+"#"+e;history.replaceState({},document.title,t)}}}showTab(){this.panelTargets.forEach(((e,t)=>{let a=this.tabTargets[t];t===this.indexValue?(e.classList.remove("hidden"),a.ariaSelected="true",a.dataset.active=!0,this.hasInactiveTabClass&&a?.classList?.remove(...this.inactiveTabClasses),this.hasActiveTabClass&&a?.classList?.add(...this.activeTabClasses)):(e.classList.add("hidden"),a.ariaSelected=null,delete a.dataset.active,this.hasActiveTabClass&&a?.classList?.remove(...this.activeTabClasses),this.hasInactiveTabClass&&a?.classList?.add(...this.inactiveTabClasses))})),this.hasSelectTarget&&(this.selectTarget.selectedIndex=this.indexValue),this.scrollActiveTabIntoViewValue&&this.scrollToActiveTab()}scrollToActiveTab(){let e=this.element.querySelector("[aria-selected]");e&&e.scrollIntoView({inline:"center"})}get tabsCount(){return this.tabTargets.length}get anchor(){return document.URL.split("#").length>1?document.URL.split("#")[1]:null}};s(c,"classes",["activeTab","inactiveTab"]),s(c,"targets",["tab","panel","select"]),s(c,"values",{index:0,updateAnchor:Boolean,scrollToAnchor:Boolean,scrollActiveTabIntoView:Boolean});var d=class extends e{toggle(e){this.openValue=!this.openValue,this.animate()}toggleInput(e){this.openValue=e.target.checked,this.animate()}hide(){this.openValue=!1,this.animate()}show(){this.openValue=!0,this.animate()}animate(){this.toggleableTargets.forEach((e=>{r(e,this.openValue)}))}};s(d,"targets",["toggleable"]),s(d,"values",{open:{type:Boolean,default:!1}});export{a as Alert,i as Autosave,n as ColorPreview,o as Dropdown,l as Modal,h as Popover,u as Slideover,c as Tabs,d as Toggle};
|
2
|
+
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: panda_cms
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Otaina Limited
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-07-
|
11
|
+
date: 2024-07-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activestorage-office-previewer
|
@@ -713,12 +713,12 @@ files:
|
|
713
713
|
- app/helpers/panda_cms/application_helper.rb
|
714
714
|
- app/helpers/panda_cms/pages_helper.rb
|
715
715
|
- app/helpers/panda_cms/theme_helper.rb
|
716
|
-
- app/javascript/
|
717
|
-
- app/javascript/
|
718
|
-
- app/javascript/
|
719
|
-
- app/javascript/
|
720
|
-
- app/javascript/
|
721
|
-
- app/javascript/
|
716
|
+
- app/javascript/base.js
|
717
|
+
- app/javascript/controllers/menu_controller.js
|
718
|
+
- app/javascript/controllers/rich_text_editor_controller.js
|
719
|
+
- app/javascript/controllers/text_field_update_controller.js
|
720
|
+
- app/javascript/vendor/stimulus-components-rails-nested-form.js
|
721
|
+
- app/javascript/vendor/tailwindcss-stimulus-components.js
|
722
722
|
- app/jobs/panda_cms/application_job.rb
|
723
723
|
- app/lib/panda_cms/demo_site_generator.rb
|
724
724
|
- app/lib/panda_cms/slug.rb
|
@@ -801,20 +801,26 @@ files:
|
|
801
801
|
- lib/templates/erb/scaffold/new.html.erb.tt
|
802
802
|
- lib/templates/erb/scaffold/partial.html.erb.tt
|
803
803
|
- lib/templates/erb/scaffold/show.html.erb.tt
|
804
|
-
- public/panda-cms-assets/android-chrome-192x192.png
|
805
|
-
- public/panda-cms-assets/android-chrome-512x512.png
|
806
|
-
- public/panda-cms-assets/apple-touch-icon.png
|
807
|
-
- public/panda-cms-assets/browserconfig.xml
|
808
|
-
- public/panda-cms-assets/
|
809
|
-
- public/panda-cms-assets/favicon-
|
810
|
-
- public/panda-cms-assets/favicon
|
811
|
-
- public/panda-cms-assets/
|
812
|
-
- public/panda-cms-assets/
|
804
|
+
- public/panda-cms-assets/favicons/android-chrome-192x192.png
|
805
|
+
- public/panda-cms-assets/favicons/android-chrome-512x512.png
|
806
|
+
- public/panda-cms-assets/favicons/apple-touch-icon.png
|
807
|
+
- public/panda-cms-assets/favicons/browserconfig.xml
|
808
|
+
- public/panda-cms-assets/favicons/favicon-16x16.png
|
809
|
+
- public/panda-cms-assets/favicons/favicon-32x32.png
|
810
|
+
- public/panda-cms-assets/favicons/favicon.ico
|
811
|
+
- public/panda-cms-assets/favicons/mstile-150x150.png
|
812
|
+
- public/panda-cms-assets/favicons/safari-pinned-tab.svg
|
813
|
+
- public/panda-cms-assets/favicons/site.webmanifest
|
814
|
+
- public/panda-cms-assets/javascripts/base.js
|
815
|
+
- public/panda-cms-assets/javascripts/controllers/menu_controller.js
|
816
|
+
- public/panda-cms-assets/javascripts/controllers/rich_text_editor_controller.js
|
817
|
+
- public/panda-cms-assets/javascripts/controllers/text_field_update_controller.js
|
818
|
+
- public/panda-cms-assets/javascripts/embed/editable.js
|
819
|
+
- public/panda-cms-assets/javascripts/vendor/stimulus-components-rails-nested-form.js
|
820
|
+
- public/panda-cms-assets/javascripts/vendor/stimulus-loading.js
|
821
|
+
- public/panda-cms-assets/javascripts/vendor/tailwindcss-stimulus-components.js
|
813
822
|
- public/panda-cms-assets/panda-logo-screenprint.png
|
814
823
|
- public/panda-cms-assets/panda-nav.png
|
815
|
-
- public/panda-cms-assets/safari-pinned-tab.svg
|
816
|
-
- public/panda-cms-assets/site.webmanifest
|
817
|
-
- public/panda-cms-assets/stimulus-loading.js
|
818
824
|
homepage: https://pandacms.io
|
819
825
|
licenses:
|
820
826
|
- BSD-3-Clause
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
/data/public/panda-cms-assets/{android-chrome-192x192.png → favicons/android-chrome-192x192.png}
RENAMED
File without changes
|
/data/public/panda-cms-assets/{android-chrome-512x512.png → favicons/android-chrome-512x512.png}
RENAMED
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
/data/public/panda-cms-assets/{stimulus-loading.js → javascripts/vendor/stimulus-loading.js}
RENAMED
File without changes
|