clapton 0.0.23 → 0.0.25
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +23 -105
- data/lib/clapton/javascripts/dist/c-for-test.js +129 -271
- data/lib/clapton/javascripts/dist/c.js +129 -271
- data/lib/clapton/javascripts/dist/client.js +3 -0
- data/lib/clapton/javascripts/dist/components-for-test.js +90 -245
- data/lib/clapton/javascripts/dist/components.js +89 -241
- data/lib/clapton/javascripts/src/c-base.ts +45 -33
- data/lib/clapton/javascripts/src/channel/clapton-channel.js +1 -0
- data/lib/clapton/javascripts/src/client.ts +1 -0
- data/lib/clapton/javascripts/src/components/{box.ts → base.ts} +6 -8
- data/lib/clapton/javascripts/src/components/block-quote.spec.ts +1 -1
- data/lib/clapton/javascripts/src/components/block-quote.ts +2 -14
- data/lib/clapton/javascripts/src/components/bold.ts +2 -14
- data/lib/clapton/javascripts/src/components/button.ts +2 -19
- data/lib/clapton/javascripts/src/components/code.ts +2 -14
- data/lib/clapton/javascripts/src/components/component.ts +28 -2
- data/lib/clapton/javascripts/src/components/{box.spec.ts → div.spec.ts} +8 -8
- data/lib/clapton/javascripts/src/components/div.ts +8 -0
- data/lib/clapton/javascripts/src/components/element.ts +3 -9
- data/lib/clapton/javascripts/src/components/emphasis.ts +2 -14
- data/lib/clapton/javascripts/src/components/form.ts +2 -14
- data/lib/clapton/javascripts/src/components/heading.ts +4 -10
- data/lib/clapton/javascripts/src/components/image.spec.ts +2 -2
- data/lib/clapton/javascripts/src/components/image.ts +3 -14
- data/lib/clapton/javascripts/src/components/input.spec.ts +16 -0
- data/lib/clapton/javascripts/src/components/{datetime-field.ts → input.ts} +9 -11
- data/lib/clapton/javascripts/src/components/link.spec.ts +6 -6
- data/lib/clapton/javascripts/src/components/link.ts +3 -16
- data/lib/clapton/javascripts/src/components/list-item.ts +2 -14
- data/lib/clapton/javascripts/src/components/list.ts +2 -14
- data/lib/clapton/javascripts/src/components/ordered-list.ts +2 -14
- data/lib/clapton/javascripts/src/components/paragraph.ts +2 -14
- data/lib/clapton/javascripts/src/components/quote.ts +2 -14
- data/lib/clapton/javascripts/src/components/select.ts +3 -5
- data/lib/clapton/javascripts/src/components/span.ts +2 -14
- data/lib/clapton/javascripts/src/components/text-area.ts +4 -9
- data/lib/clapton/javascripts/src/components-for-test.ts +3 -6
- data/lib/clapton/javascripts/src/components.ts +3 -6
- data/lib/clapton/javascripts/src/dom/update-component.ts +1 -0
- data/lib/clapton/test_helper/base.rb +4 -4
- data/lib/clapton/version.rb +1 -1
- metadata +7 -14
- data/lib/clapton/javascripts/dist/c +0 -559
- data/lib/clapton/javascripts/dist/c-base.js +0 -589
- data/lib/clapton/javascripts/src/components/checkbox.spec.ts +0 -16
- data/lib/clapton/javascripts/src/components/checkbox.ts +0 -23
- data/lib/clapton/javascripts/src/components/datetime-field.spec.ts +0 -16
- data/lib/clapton/javascripts/src/components/radio-button.spec.ts +0 -16
- data/lib/clapton/javascripts/src/components/radio-button.ts +0 -23
- data/lib/clapton/javascripts/src/components/text-field.spec.ts +0 -16
- data/lib/clapton/javascripts/src/components/text-field.ts +0 -23
@@ -1,10 +1,8 @@
|
|
1
1
|
import { BlockQuote } from "./components/block-quote"
|
2
|
-
import {
|
2
|
+
import { Div } from "./components/div"
|
3
3
|
import { Bold } from "./components/bold"
|
4
4
|
import { Button } from "./components/button"
|
5
|
-
import { Checkbox } from "./components/checkbox"
|
6
5
|
import { Code } from "./components/code"
|
7
|
-
import { DateTimeField } from "./components/datetime-field"
|
8
6
|
import { Element } from "./components/element"
|
9
7
|
import { Embed } from "./components/embed"
|
10
8
|
import { Emphasis } from "./components/emphasis"
|
@@ -17,14 +15,13 @@ import { List } from "./components/list"
|
|
17
15
|
import { OrderedList } from "./components/ordered-list"
|
18
16
|
import { Paragraph } from "./components/paragraph"
|
19
17
|
import { Quote } from "./components/quote"
|
20
|
-
import { RadioButton } from "./components/radio-button"
|
21
18
|
import { Select } from "./components/select"
|
22
19
|
import { Span } from "./components/span"
|
23
20
|
import { Component } from "./components/component"
|
24
|
-
import {
|
21
|
+
import { Input } from "./components/input"
|
25
22
|
import { Text } from "./components/text"
|
26
23
|
import { TextArea } from "./components/text-area"
|
27
24
|
|
28
25
|
export {
|
29
|
-
Component,
|
26
|
+
Component, Div, Text, Button, BlockQuote, Code, Element, Emphasis, Form, Heading, Image, Link, List, ListItem, OrderedList, Paragraph, Input, Quote, Select, Span, Embed, Bold, TextArea
|
30
27
|
};
|
@@ -1,10 +1,8 @@
|
|
1
1
|
import { BlockQuote } from "./components/block-quote"
|
2
|
-
import {
|
2
|
+
import { Div } from "./components/div"
|
3
3
|
import { Button } from "./components/button"
|
4
4
|
import { Bold } from "./components/bold"
|
5
|
-
import { Checkbox } from "./components/checkbox"
|
6
5
|
import { Code } from "./components/code"
|
7
|
-
import { DateTimeField } from "./components/datetime-field"
|
8
6
|
import { Element } from "./components/element"
|
9
7
|
import { Embed } from "./components/embed"
|
10
8
|
import { Emphasis } from "./components/emphasis"
|
@@ -17,14 +15,13 @@ import { List } from "./components/list"
|
|
17
15
|
import { OrderedList } from "./components/ordered-list"
|
18
16
|
import { Paragraph } from "./components/paragraph"
|
19
17
|
import { Quote } from "./components/quote"
|
20
|
-
import { RadioButton } from "./components/radio-button"
|
21
18
|
import { Select } from "./components/select"
|
22
19
|
import { Span } from "./components/span"
|
23
20
|
import { Component } from "./components/component"
|
24
|
-
import {
|
21
|
+
import { Input } from "./components/input"
|
25
22
|
import { Text } from "./components/text"
|
26
23
|
import { TextArea } from "./components/text-area"
|
27
24
|
|
28
25
|
export const Clapton = {
|
29
|
-
|
26
|
+
Div, Component, Text, Input, Button, BlockQuote, Code, Element, Emphasis, Form, Heading, Image, Link, List, ListItem, OrderedList, Paragraph, Quote, Select, Span, Embed, Bold, TextArea
|
30
27
|
};
|
@@ -7,4 +7,5 @@ export const updateComponent = async (component: HTMLElement, state: any, proper
|
|
7
7
|
const ComponentClass = module[componentName] as any;
|
8
8
|
const instance = new ComponentClass(state, component.dataset.id);
|
9
9
|
morphdom(component, instance.renderWrapper);
|
10
|
+
instance.runEffects();
|
10
11
|
};
|
@@ -12,10 +12,10 @@ module Clapton
|
|
12
12
|
js += "\n"
|
13
13
|
end
|
14
14
|
js = js.sub("const Clapton = {
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
15
|
+
Div, Component, Text, Input, Button, BlockQuote, Code, Element, Emphasis, Form, Heading, Image, Link, List, ListItem, OrderedList, Paragraph, Quote, Select, Span, Embed, Bold, TextArea
|
16
|
+
};", "const Clapton = {
|
17
|
+
Div, Text, Input, Button, BlockQuote, Code, Element, Emphasis, Form, Heading, Image, Link, List, ListItem, OrderedList, Paragraph, Quote, Select, Span, Embed, Bold, TextArea
|
18
|
+
};")
|
19
19
|
context = ExecJS.compile(js)
|
20
20
|
html = context.eval("new #{component.name.camelize}(#{params.to_json}).renderWrapper")
|
21
21
|
@page = Capybara.string(html)
|
data/lib/clapton/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: clapton
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.25
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Moeki Kawakami
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-10-
|
11
|
+
date: 2024-10-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -130,8 +130,6 @@ files:
|
|
130
130
|
- config/routes.rb
|
131
131
|
- lib/clapton.rb
|
132
132
|
- lib/clapton/engine.rb
|
133
|
-
- lib/clapton/javascripts/dist/c
|
134
|
-
- lib/clapton/javascripts/dist/c-base.js
|
135
133
|
- lib/clapton/javascripts/dist/c-for-test.js
|
136
134
|
- lib/clapton/javascripts/dist/c.js
|
137
135
|
- lib/clapton/javascripts/dist/client.js
|
@@ -6713,21 +6711,18 @@ files:
|
|
6713
6711
|
- lib/clapton/javascripts/src/client.ts
|
6714
6712
|
- lib/clapton/javascripts/src/components-for-test.ts
|
6715
6713
|
- lib/clapton/javascripts/src/components.ts
|
6714
|
+
- lib/clapton/javascripts/src/components/base.ts
|
6716
6715
|
- lib/clapton/javascripts/src/components/block-quote.spec.ts
|
6717
6716
|
- lib/clapton/javascripts/src/components/block-quote.ts
|
6718
6717
|
- lib/clapton/javascripts/src/components/bold.spec.ts
|
6719
6718
|
- lib/clapton/javascripts/src/components/bold.ts
|
6720
|
-
- lib/clapton/javascripts/src/components/box.spec.ts
|
6721
|
-
- lib/clapton/javascripts/src/components/box.ts
|
6722
6719
|
- lib/clapton/javascripts/src/components/button.spec.ts
|
6723
6720
|
- lib/clapton/javascripts/src/components/button.ts
|
6724
|
-
- lib/clapton/javascripts/src/components/checkbox.spec.ts
|
6725
|
-
- lib/clapton/javascripts/src/components/checkbox.ts
|
6726
6721
|
- lib/clapton/javascripts/src/components/code.spec.ts
|
6727
6722
|
- lib/clapton/javascripts/src/components/code.ts
|
6728
6723
|
- lib/clapton/javascripts/src/components/component.ts
|
6729
|
-
- lib/clapton/javascripts/src/components/
|
6730
|
-
- lib/clapton/javascripts/src/components/
|
6724
|
+
- lib/clapton/javascripts/src/components/div.spec.ts
|
6725
|
+
- lib/clapton/javascripts/src/components/div.ts
|
6731
6726
|
- lib/clapton/javascripts/src/components/element.spec.ts
|
6732
6727
|
- lib/clapton/javascripts/src/components/element.ts
|
6733
6728
|
- lib/clapton/javascripts/src/components/embed.spec.ts
|
@@ -6740,6 +6735,8 @@ files:
|
|
6740
6735
|
- lib/clapton/javascripts/src/components/heading.ts
|
6741
6736
|
- lib/clapton/javascripts/src/components/image.spec.ts
|
6742
6737
|
- lib/clapton/javascripts/src/components/image.ts
|
6738
|
+
- lib/clapton/javascripts/src/components/input.spec.ts
|
6739
|
+
- lib/clapton/javascripts/src/components/input.ts
|
6743
6740
|
- lib/clapton/javascripts/src/components/link.spec.ts
|
6744
6741
|
- lib/clapton/javascripts/src/components/link.ts
|
6745
6742
|
- lib/clapton/javascripts/src/components/list-item.spec.ts
|
@@ -6752,16 +6749,12 @@ files:
|
|
6752
6749
|
- lib/clapton/javascripts/src/components/paragraph.ts
|
6753
6750
|
- lib/clapton/javascripts/src/components/quote.spec.ts
|
6754
6751
|
- lib/clapton/javascripts/src/components/quote.ts
|
6755
|
-
- lib/clapton/javascripts/src/components/radio-button.spec.ts
|
6756
|
-
- lib/clapton/javascripts/src/components/radio-button.ts
|
6757
6752
|
- lib/clapton/javascripts/src/components/select.spec.ts
|
6758
6753
|
- lib/clapton/javascripts/src/components/select.ts
|
6759
6754
|
- lib/clapton/javascripts/src/components/span.spec.ts
|
6760
6755
|
- lib/clapton/javascripts/src/components/span.ts
|
6761
6756
|
- lib/clapton/javascripts/src/components/text-area.spec.ts
|
6762
6757
|
- lib/clapton/javascripts/src/components/text-area.ts
|
6763
|
-
- lib/clapton/javascripts/src/components/text-field.spec.ts
|
6764
|
-
- lib/clapton/javascripts/src/components/text-field.ts
|
6765
6758
|
- lib/clapton/javascripts/src/components/text.spec.ts
|
6766
6759
|
- lib/clapton/javascripts/src/components/text.ts
|
6767
6760
|
- lib/clapton/javascripts/src/dom/update-component.ts
|