tailwind_dsl 0.0.30 → 0.0.32

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3377172941fc6ad9c2db29fa772f5743714f73ac4b4ef69f911069cb00c4c9d8
4
- data.tar.gz: e0204ff9d27587aedac8f33a84d1019eaffafdefb2a8793669d2cdf03f9ea9f8
3
+ metadata.gz: 9025cf15ba76557110066103a8aa08316f6f49a1e45d5d12e9a46c1874aa3039
4
+ data.tar.gz: 8e4a351392d28eb6e5cf72f4dfdd62e7204bea2ce2d6a6129b02c05adec3cfe5
5
5
  SHA512:
6
- metadata.gz: cd678c918f7b5de5a6bc91c25988f12e0de6da89a5212aeb9f363ffcaa4b0b79fb21a937c7d2d9bf8b49ecc76d43c673b0f150eca91d0907b029b25a1ed1738e
7
- data.tar.gz: a0e1be62691f5aff54e4326658048968eb222b9c8002348e37950961fecba68e4aa424daeb01fd7c4ae6d1ccbb0a92338638b124325596d4235addefece8ad9b
6
+ metadata.gz: b44825c69209437c345b3aa636805418a3c6728ff395f5928006f9f3eb0a556e79222225b50246e3ecd49866e90a15d92c786e7c84c0130ceace9e2fdda9ad91
7
+ data.tar.gz: 6757841b4bc58b4169154561c4052e8dbbfb5bbf90931e21fcd181342a727e5ea9c2fb89f7ff25140e41a65d2dcdfa1473245f4a095de1cd81f2f00192c7a6a1
@@ -0,0 +1,26 @@
1
+ require 'gpt3/builder'
2
+
3
+ # Send an email to the user
4
+ #
5
+ # @param [String] use_ses - use AWS SES to send the email, if you are just testing, then set this value to false
6
+ def send_email(use_ses = nil)
7
+ use_ses ||= true
8
+
9
+ puts 'email sent successfully via Amazon Simple Email Service' if use_ses
10
+ end
11
+
12
+ KManager.action :test do
13
+ action do
14
+
15
+ # Send an email to the user
16
+ send_email
17
+
18
+ # Send an email to the user
19
+ send_email(true)
20
+
21
+ # This is a test, don't send the email
22
+ send_email(false)
23
+ end
24
+ end
25
+
26
+ KManager.opts.sleep = 2
@@ -35,8 +35,16 @@ KManager.action :utilities do
35
35
  components,
36
36
  target_component_model_path,
37
37
  batch_size: 1,
38
- use_prompt: true,
39
- filter_design_system: 'tui',
38
+ filter: {
39
+ design_system: 'tui',
40
+ exclude_group_key: [
41
+ 'application_ui.application_shells.multi_column',
42
+ 'application_ui.application_shells.sidebar',
43
+ 'application_ui.application_shells.stacked',
44
+ 'application_ui.component.element.avatars',
45
+ 'application_ui.component.element.badges'
46
+ ]
47
+ },
40
48
  extract_handler: TailwindDsl::Etl::Extractors::DataExtractor
41
49
  )
42
50
  # puts target_component_path
@@ -79,13 +87,12 @@ KManager.action :utilities do
79
87
  # Extracts the next component data using GPT3
80
88
  #
81
89
  # This needs to be supervised and verified, so it will only do a few models at a time
82
- def batch_extraction(components, target_folder, batch_size: 1, use_prompt: false, filter_design_system: nil, extract_handler: nil)
90
+ def batch_extraction(components, target_folder, batch_size: 1, filter: nil, extract_handler: nil)
83
91
  extraction = TailwindDsl::Etl::Extractors::BatchExtraction.new(
84
92
  components,
85
93
  target_folder,
86
94
  batch_size: batch_size,
87
- use_prompt: use_prompt,
88
- filter_design_system: filter_design_system,
95
+ filter: filter,
89
96
  extract_handler: extract_handler)
90
97
  extraction.extract
91
98
  end
@@ -0,0 +1,37 @@
1
+ {
2
+ "todo": "SVG Icons and Profile Name in footer",
3
+ "sidebar": {
4
+ "items": [
5
+ {
6
+ "title": "Dashboard",
7
+ "icon": "Dashboard",
8
+ "url": "/dashboard"
9
+ },
10
+ {
11
+ "title": "Calendar",
12
+ "icon": "Calendar",
13
+ "url": "/calendar"
14
+ },
15
+ {
16
+ "title": "Teams",
17
+ "icon": "Teams",
18
+ "url": "/teams"
19
+ },
20
+ {
21
+ "title": "Directory",
22
+ "icon": "Directory",
23
+ "url": "/directory"
24
+ },
25
+ {
26
+ "title": "Announcements",
27
+ "icon": "Announcements",
28
+ "url": "/announcements"
29
+ },
30
+ {
31
+ "title": "Office Map",
32
+ "icon": "OfficeMap",
33
+ "url": "/office-map"
34
+ }
35
+ ]
36
+ }
37
+ }
@@ -0,0 +1,32 @@
1
+
2
+ {
3
+ "classes": [
4
+ {
5
+ "alias": "left",
6
+ "class": "relative inline-flex items-center rounded-l-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 focus:z-10 focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500"
7
+ },
8
+ {
9
+ "alias": "middle",
10
+ "class": "relative -ml-px inline-flex items-center border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 focus:z-10 focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500"
11
+ },
12
+ {
13
+ "alias": "right",
14
+ "class": "relative -ml-px inline-flex items-center rounded-r-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 focus:z-10 focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500"
15
+ }
16
+ ],
17
+ "type": "button-groups",
18
+ "buttons": [
19
+ {
20
+ "text": "Years",
21
+ "alias": "left"
22
+ },
23
+ {
24
+ "text": "Months",
25
+ "alias": "middle"
26
+ },
27
+ {
28
+ "text": "Days",
29
+ "alias": "right"
30
+ }
31
+ ]
32
+ }
@@ -0,0 +1,13 @@
1
+ {
2
+ "type": "button-groups",
3
+ "buttons": [
4
+ {
5
+ "text": "Previous",
6
+ "icon": "chevron-left"
7
+ },
8
+ {
9
+ "text": "Next",
10
+ "icon": "chevron-right"
11
+ }
12
+ ]
13
+ }
@@ -0,0 +1,24 @@
1
+ {
2
+ "classes": [
3
+ {
4
+ "alias": "left",
5
+ "class": "relative inline-flex items-center rounded-l-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 focus:z-10 focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500"
6
+ },
7
+ {
8
+ "alias": "right",
9
+ "class": "relative -ml-px inline-flex items-center rounded-r-md border border-gray-300 bg-white px-3 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 focus:z-10 focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500"
10
+ }
11
+ ],
12
+ "type": "button-groups",
13
+ "buttons": [
14
+ {
15
+ "alias": "left",
16
+ "text": "Bookmark",
17
+ "icon": "bookmark"
18
+ },
19
+ {
20
+ "alias": "right",
21
+ "text": "12k"
22
+ }
23
+ ]
24
+ }
@@ -0,0 +1,44 @@
1
+ {
2
+ "classes": [
3
+ {
4
+ "alias": "primary_button",
5
+ "class": "relative inline-flex items-center rounded-l-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 focus:z-10 focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500"
6
+ },
7
+ {
8
+ "alias": "dropdown_button",
9
+ "class": "relative inline-flex items-center rounded-r-md border border-gray-300 bg-white px-2 py-2 text-sm font-medium text-gray-500 hover:bg-gray-50 focus:z-10 focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500"
10
+ },
11
+ {
12
+ "alias": "menu_item",
13
+ "class": "text-gray-700 block px-4 py-2 text-sm"
14
+ }
15
+ ],
16
+ "type": "button-groups",
17
+ "primary_button": {
18
+ "text": "Save changes",
19
+ "alias": "primary_button"
20
+ },
21
+ "dropdown_button": {
22
+ "sr_text": "Open options",
23
+ "alias": "dropdown_button",
24
+ },
25
+ "dropdown_menu": {
26
+ "items": [
27
+ {
28
+ "text": "Save and schedule",
29
+ "alias": "menu_item",
30
+ "href": "#"
31
+ },
32
+ {
33
+ "text": "Save and publish",
34
+ "alias": "menu_item",
35
+ "href": "#"
36
+ },
37
+ {
38
+ "text": "Export PDF",
39
+ "alias": "menu_item",
40
+ "href": "#"
41
+ }
42
+ ]
43
+ }
44
+ }
@@ -0,0 +1,15 @@
1
+
2
+ {
3
+ "classes": [
4
+ {
5
+ "alias": "dropdown_button",
6
+ "class": "-ml-px block w-full rounded-l-none rounded-r-md border border-gray-300 bg-white py-2 pl-3 pr-9 text-sm font-medium text-gray-700 hover:bg-gray-50 focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500"
7
+ }
8
+ ],
9
+ "type": "button-groups",
10
+ "dropdown_options": [
11
+ "Unread messages",
12
+ "Sent messages",
13
+ "All messages"
14
+ ]
15
+ }
@@ -0,0 +1,14 @@
1
+ [
2
+ {
3
+ "alias": "chevron-left",
4
+ "icon_path": "M12.79 5.23a.75.75 0 01-.02 1.06L8.832 10l3.938 3.71a.75.75 0 11-1.04 1.08l-4.5-4.25a.75.75 0 010-1.08l4.5-4.25a.75.75 0 011.06.02z"
5
+ },
6
+ {
7
+ "alias": "chevron-right",
8
+ "icon_path": "M7.21 14.77a.75.75 0 01.02-1.06L11.168 10 7.23 6.29a.75.75 0 111.04-1.08l4.5 4.25a.75.75 0 010 1.08l-4.5 4.25a.75.75 0 01-1.06-.02z"
9
+ },
10
+ {
11
+ "alias": "bookmark",
12
+ "icon_path": "M10 1c-1.716 0-3.408.106-5.07.31C3.806 1.45 3 2.414 3 3.517V18.25a.75.75 0 001.075.676L10 16.082l5.925 2.844A.75.75 0 0017 18.25V3.517c0-1.103-.806-2.068-1.93-2.207A41.403 41.403 0 0010 1z"
13
+ }
14
+ ]
data/CHANGELOG.md CHANGED
@@ -1,3 +1,17 @@
1
+ ## [0.0.31](https://github.com/klueless-io/tailwind_dsl/compare/v0.0.30...v0.0.31) (2022-10-27)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * add inclusion and exclusion filters for arrays ([06ee1d1](https://github.com/klueless-io/tailwind_dsl/commit/06ee1d19ac9f5a71cafcfa618bd307363a9dd5ab))
7
+
8
+ ## [0.0.30](https://github.com/klueless-io/tailwind_dsl/compare/v0.0.29...v0.0.30) (2022-10-26)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * add inclusion and exclusion filters ([f1112bd](https://github.com/klueless-io/tailwind_dsl/commit/f1112bd926e31efa2f2e7e76df91e9ccd02b4dbe))
14
+
1
15
  ## [0.0.29](https://github.com/klueless-io/tailwind_dsl/compare/v0.0.28...v0.0.29) (2022-10-26)
2
16
 
3
17
 
@@ -70,19 +70,22 @@ module TailwindDsl
70
70
  raise "Folder does not exist: '#{path}', make sure you run component structure generator first." unless File.exist?(path)
71
71
  end
72
72
 
73
- # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity
73
+ # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
74
74
  def filter_components
75
75
  return components unless filter
76
76
 
77
77
  result = components
78
78
  # inclusions
79
79
  result = result.select { |component| component.design_system.name == filter[:design_system] } if filter[:design_system]
80
- result = result.select { |component| component.group.key == filter[:group_key] } if filter[:group_key]
80
+ result = result.select { |component| component.group.key == filter[:group_key] } if filter[:group_key].is_a?(String)
81
+ result = result.select { |component| filter[:group_key].include?(component.group.key) } if filter[:group_key].is_a?(Array)
81
82
  # exclusions
82
- result = result.reject { |component| component.group.key == filter[:exclude_group_key] } if filter[:exclude_group_key]
83
+ result = result.reject { |component| component.group.key == filter[:exclude_group_key] } if filter[:exclude_group_key].is_a?(String)
84
+ result = result.reject { |component| filter[:exclude_group_key].include?(component.group.key) } if filter[:exclude_group_key].is_a?(Array)
85
+
83
86
  result
84
87
  end
85
- # rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity
88
+ # rubocop:enable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/PerceivedComplexity
86
89
  end
87
90
  end
88
91
  end
@@ -15,7 +15,7 @@ module TailwindDsl
15
15
  def extract
16
16
  builder = Gpt3::Builder::Gpt3Builder.init
17
17
 
18
- tokens = 250
18
+ tokens = 700
19
19
 
20
20
  source_file = component.absolute.target_clean_html_file
21
21
  source = File.read(source_file)
@@ -30,6 +30,9 @@ module TailwindDsl
30
30
  .message('JSON:')
31
31
  .complete(engine: 'code-davinci-002', max_tokens: tokens, suffix: "\n")
32
32
  .write_result(target_file)
33
+
34
+ puts "Extracted data for #{component_type} component: #{component.name} into file"
35
+ puts target_file
33
36
  end
34
37
  # rubocop:enable Metrics/AbcSize
35
38
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module TailwindDsl
4
- VERSION = '0.0.30'
4
+ VERSION = '0.0.32'
5
5
  end
data/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "tailwind_dsl",
3
- "version": "0.0.30",
3
+ "version": "0.0.32",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "tailwind_dsl",
9
- "version": "0.0.30",
9
+ "version": "0.0.32",
10
10
  "devDependencies": {
11
11
  "@klueless-js/semantic-release-rubygem": "github:klueless-js/semantic-release-rubygem",
12
12
  "@semantic-release/changelog": "^6.0.1",
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tailwind_dsl",
3
- "version": "0.0.30",
3
+ "version": "0.0.32",
4
4
  "description": "Tailwind DSL will build tailwind websites useing Domain Specific Language conventions",
5
5
  "scripts": {
6
6
  "release": "semantic-release"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tailwind_dsl
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.30
4
+ version: 0.0.32
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Cruwys
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-10-26 00:00:00.000000000 Z
11
+ date: 2022-10-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cmdlet
@@ -70,9 +70,11 @@ files:
70
70
  - ".builders/generators/domain-model-to-code.rb"
71
71
  - ".builders/generators/domain-model.rb"
72
72
  - ".builders/generators/project-plan.rb"
73
+ - ".builders/generators/test.rb"
73
74
  - ".builders/generators/utilities.rb"
74
75
  - ".components/readme.md"
75
76
  - ".components/tui/application-ui/application-shells/multi-column/01.clean.html"
77
+ - ".components/tui/application-ui/application-shells/multi-column/01.data.json"
76
78
  - ".components/tui/application-ui/application-shells/multi-column/01.html"
77
79
  - ".components/tui/application-ui/application-shells/multi-column/01.settings.json"
78
80
  - ".components/tui/application-ui/application-shells/multi-column/02.clean.html"
@@ -209,18 +211,23 @@ files:
209
211
  - ".components/tui/application-ui/component/element/badges/07.html"
210
212
  - ".components/tui/application-ui/component/element/badges/07.settings.json"
211
213
  - ".components/tui/application-ui/component/element/button-groups/01.clean.html"
214
+ - ".components/tui/application-ui/component/element/button-groups/01.data.json"
212
215
  - ".components/tui/application-ui/component/element/button-groups/01.html"
213
216
  - ".components/tui/application-ui/component/element/button-groups/01.settings.json"
214
217
  - ".components/tui/application-ui/component/element/button-groups/02.clean.html"
218
+ - ".components/tui/application-ui/component/element/button-groups/02.data.json"
215
219
  - ".components/tui/application-ui/component/element/button-groups/02.html"
216
220
  - ".components/tui/application-ui/component/element/button-groups/02.settings.json"
217
221
  - ".components/tui/application-ui/component/element/button-groups/03.clean.html"
222
+ - ".components/tui/application-ui/component/element/button-groups/03.data.json"
218
223
  - ".components/tui/application-ui/component/element/button-groups/03.html"
219
224
  - ".components/tui/application-ui/component/element/button-groups/03.settings.json"
220
225
  - ".components/tui/application-ui/component/element/button-groups/04.clean.html"
226
+ - ".components/tui/application-ui/component/element/button-groups/04.data.json"
221
227
  - ".components/tui/application-ui/component/element/button-groups/04.html"
222
228
  - ".components/tui/application-ui/component/element/button-groups/04.settings.json"
223
229
  - ".components/tui/application-ui/component/element/button-groups/05.clean.html"
230
+ - ".components/tui/application-ui/component/element/button-groups/05.data.json"
224
231
  - ".components/tui/application-ui/component/element/button-groups/05.html"
225
232
  - ".components/tui/application-ui/component/element/button-groups/05.settings.json"
226
233
  - ".components/tui/application-ui/component/element/button-groups/05.tailwind.config.js"
@@ -1680,6 +1687,7 @@ files:
1680
1687
  - ".components/tui/ecommerce/page/store-front-pages/04.html"
1681
1688
  - ".components/tui/ecommerce/page/store-front-pages/04.settings.json"
1682
1689
  - ".components/tui/ecommerce/page/store-front-pages/04.tailwind.config.js"
1690
+ - ".components/tui/icons.data.json"
1683
1691
  - ".components/tui/marketing/element/banner/01.clean.html"
1684
1692
  - ".components/tui/marketing/element/banner/01.html"
1685
1693
  - ".components/tui/marketing/element/banner/01.settings.json"