builder-settings-types 0.0.4 → 0.0.6

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,6 @@
1
+ "use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});class s{constructor(t={}){this.props=t,this.title=t.title||"Setting",this.value=t.defaultValue}defaultDraw(){const t=document.createElement("div"),e=document.createElement("label");e.textContent=this.title??"";const r=document.createElement("input");return r.type=this.inputType,r.placeholder=this.props.placeholder||`Enter ${this.title}`,r.value=this.value!==void 0?String(this.value):"",t.appendChild(e),t.appendChild(r),t}}const o=Object.freeze(Object.defineProperty({__proto__:null,Setting:s},Symbol.toStringTag,{value:"Module"}));class l{constructor(t){this.title=t.title,this.settings=t.settings,Object.assign(this,t.settings)}}const a=Object.freeze(Object.defineProperty({__proto__:null,SettingGroup:l},Symbol.toStringTag,{value:"Module"}));class i extends s{constructor(t={}){super(t),this.props=t,this.inputType="number"}draw(){const t=super.defaultDraw(),e=t.querySelector("input");return this.props.minValue!==void 0&&(e.min=String(this.props.minValue)),this.props.maxValue!==void 0&&(e.max=String(this.props.maxValue)),this.props.className&&e.classList.add(this.props.className),t}}const g=Object.freeze(Object.defineProperty({__proto__:null,NumberSetting:i},Symbol.toStringTag,{value:"Module"}));class u extends l{constructor(){super({title:"Margin",settings:{margin:new i({title:"Margin All"}),marginTop:new i({title:"Margin Top"}),marginRight:new i({title:"Margin Right"}),marginBottom:new i({title:"Margin Bottom"}),marginLeft:new i({title:"Margin Left"})}})}getCssCode(){return`
2
+ margin-botton: ${this.settings.marginBottom.value}px;
3
+ margin-top: ${this.settings.marginTop.value}px;
4
+ margin-right: ${this.settings.marginRight.value}px;
5
+ margin-left: ${this.settings.marginLeft.value}px;
6
+ `}}const c=Object.freeze(Object.defineProperty({__proto__:null,MarginSetting:u},Symbol.toStringTag,{value:"Module"}));class p extends s{constructor(t={}){super(t),this.inputType="text"}draw(){return super.defaultDraw()}}const d=Object.freeze(Object.defineProperty({__proto__:null,StringSetting:p},Symbol.toStringTag,{value:"Module"}));function m(){console.log("logg yes fixed")}const h={setting:o,settingsGroup:a,marginSettings:c,numberSettings:g,stringSettings:d};exports.default=h;exports.logger=m;
@@ -1,28 +1,28 @@
1
- class s {
1
+ class r {
2
2
  constructor(t = {}) {
3
3
  this.props = t, this.title = t.title || "Setting", this.value = t.defaultValue;
4
4
  }
5
5
  defaultDraw() {
6
6
  const t = document.createElement("div"), e = document.createElement("label");
7
7
  e.textContent = this.title ?? "";
8
- const r = document.createElement("input");
9
- return r.type = this.inputType, r.placeholder = this.props.placeholder || `Enter ${this.title}`, r.value = this.value !== void 0 ? String(this.value) : "", t.appendChild(e), t.appendChild(r), t;
8
+ const s = document.createElement("input");
9
+ return s.type = this.inputType, s.placeholder = this.props.placeholder || `Enter ${this.title}`, s.value = this.value !== void 0 ? String(this.value) : "", t.appendChild(e), t.appendChild(s), t;
10
10
  }
11
11
  }
12
- const a = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
12
+ const o = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
13
13
  __proto__: null,
14
- Setting: s
14
+ Setting: r
15
15
  }, Symbol.toStringTag, { value: "Module" }));
16
16
  class l {
17
17
  constructor(t) {
18
18
  this.title = t.title, this.settings = t.settings, Object.assign(this, t.settings);
19
19
  }
20
20
  }
21
- const o = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
21
+ const a = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
22
22
  __proto__: null,
23
23
  SettingGroup: l
24
24
  }, Symbol.toStringTag, { value: "Module" }));
25
- class i extends s {
25
+ class i extends r {
26
26
  constructor(t = {}) {
27
27
  super(t), this.props = t, this.inputType = "number";
28
28
  }
@@ -31,11 +31,11 @@ class i extends s {
31
31
  return this.props.minValue !== void 0 && (e.min = String(this.props.minValue)), this.props.maxValue !== void 0 && (e.max = String(this.props.maxValue)), this.props.className && e.classList.add(this.props.className), t;
32
32
  }
33
33
  }
34
- const u = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
34
+ const g = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
35
35
  __proto__: null,
36
36
  NumberSetting: i
37
37
  }, Symbol.toStringTag, { value: "Module" }));
38
- class g extends l {
38
+ class u extends l {
39
39
  constructor() {
40
40
  super({
41
41
  title: "Margin",
@@ -59,9 +59,9 @@ class g extends l {
59
59
  }
60
60
  const p = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
61
61
  __proto__: null,
62
- MarginSetting: g
62
+ MarginSetting: u
63
63
  }, Symbol.toStringTag, { value: "Module" }));
64
- class c extends s {
64
+ class c extends r {
65
65
  constructor(t = {}) {
66
66
  super(t), this.inputType = "text";
67
67
  }
@@ -72,13 +72,18 @@ class c extends s {
72
72
  const m = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
73
73
  __proto__: null,
74
74
  StringSetting: c
75
- }, Symbol.toStringTag, { value: "Module" })), d = {
76
- setting: a,
77
- settingsGroup: o,
75
+ }, Symbol.toStringTag, { value: "Module" }));
76
+ function d() {
77
+ console.log("logg yes fixed");
78
+ }
79
+ const h = {
80
+ setting: o,
81
+ settingsGroup: a,
78
82
  marginSettings: p,
79
- numberSettings: u,
83
+ numberSettings: g,
80
84
  stringSettings: m
81
85
  };
82
86
  export {
83
- d as default
87
+ h as default,
88
+ d as logger
84
89
  };
package/dist/index.d.ts CHANGED
@@ -7,6 +7,8 @@ declare const _default: {
7
7
  };
8
8
  export default _default;
9
9
 
10
+ export declare function logger(): void;
11
+
10
12
  declare class MarginSetting extends SettingGroup<{
11
13
  margin: NumberSetting;
12
14
  marginTop: NumberSetting;
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "builder-settings-types",
3
3
  "description": "builder settings",
4
- "version": "0.0.4",
4
+ "version": "0.0.6",
5
5
  "type": "module",
6
- "main": "dist/builder-settings.cjs.js",
7
- "module": "dist/builder-settings.es.js",
6
+ "main": "dist/builder-settings-types.cjs.js",
7
+ "module": "dist/builder-settings-types.es.js",
8
8
  "types": "dist/index.d.ts",
9
9
  "scripts": {
10
10
  "dev": "vite",
package/src/index.ts CHANGED
@@ -4,6 +4,10 @@ import * as marginSettings from "./marginSettings";
4
4
  import * as numberSettings from "./numberSettings";
5
5
  import * as stringSettings from "./stringSettings";
6
6
 
7
+ export function logger() {
8
+ console.log("logg yes fixed")
9
+ }
10
+
7
11
  export default {
8
12
  setting,
9
13
  settingsGroup,
package/vite.config.ts CHANGED
@@ -14,8 +14,8 @@ export default defineConfig({
14
14
  build: {
15
15
  lib: {
16
16
  entry: "src/index.ts",
17
- name: "builder-settings",
18
- fileName: (format) => `builder-settings.${format}.js`,
17
+ name: "builder-settings-types",
18
+ fileName: (format) => `builder-settings-types.${format}.js`,
19
19
  formats: ["es", "cjs"],
20
20
  },
21
21
  rollupOptions: {
@@ -1,6 +0,0 @@
1
- "use strict";class r{constructor(t={}){this.props=t,this.title=t.title||"Setting",this.value=t.defaultValue}defaultDraw(){const t=document.createElement("div"),e=document.createElement("label");e.textContent=this.title??"";const s=document.createElement("input");return s.type=this.inputType,s.placeholder=this.props.placeholder||`Enter ${this.title}`,s.value=this.value!==void 0?String(this.value):"",t.appendChild(e),t.appendChild(s),t}}const o=Object.freeze(Object.defineProperty({__proto__:null,Setting:r},Symbol.toStringTag,{value:"Module"}));class l{constructor(t){this.title=t.title,this.settings=t.settings,Object.assign(this,t.settings)}}const a=Object.freeze(Object.defineProperty({__proto__:null,SettingGroup:l},Symbol.toStringTag,{value:"Module"}));class i extends r{constructor(t={}){super(t),this.props=t,this.inputType="number"}draw(){const t=super.defaultDraw(),e=t.querySelector("input");return this.props.minValue!==void 0&&(e.min=String(this.props.minValue)),this.props.maxValue!==void 0&&(e.max=String(this.props.maxValue)),this.props.className&&e.classList.add(this.props.className),t}}const u=Object.freeze(Object.defineProperty({__proto__:null,NumberSetting:i},Symbol.toStringTag,{value:"Module"}));class g extends l{constructor(){super({title:"Margin",settings:{margin:new i({title:"Margin All"}),marginTop:new i({title:"Margin Top"}),marginRight:new i({title:"Margin Right"}),marginBottom:new i({title:"Margin Bottom"}),marginLeft:new i({title:"Margin Left"})}})}getCssCode(){return`
2
- margin-botton: ${this.settings.marginBottom.value}px;
3
- margin-top: ${this.settings.marginTop.value}px;
4
- margin-right: ${this.settings.marginRight.value}px;
5
- margin-left: ${this.settings.marginLeft.value}px;
6
- `}}const p=Object.freeze(Object.defineProperty({__proto__:null,MarginSetting:g},Symbol.toStringTag,{value:"Module"}));class c extends r{constructor(t={}){super(t),this.inputType="text"}draw(){return super.defaultDraw()}}const m=Object.freeze(Object.defineProperty({__proto__:null,StringSetting:c},Symbol.toStringTag,{value:"Module"})),d={setting:o,settingsGroup:a,marginSettings:p,numberSettings:u,stringSettings:m};module.exports=d;