tina4ruby 0.4.0
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 +7 -0
- data/CHANGELOG.md +80 -0
- data/LICENSE.txt +21 -0
- data/README.md +768 -0
- data/exe/tina4 +4 -0
- data/lib/tina4/api.rb +152 -0
- data/lib/tina4/auth.rb +139 -0
- data/lib/tina4/cli.rb +349 -0
- data/lib/tina4/crud.rb +124 -0
- data/lib/tina4/database.rb +135 -0
- data/lib/tina4/database_result.rb +89 -0
- data/lib/tina4/debug.rb +83 -0
- data/lib/tina4/dev.rb +15 -0
- data/lib/tina4/dev_reload.rb +68 -0
- data/lib/tina4/drivers/firebird_driver.rb +94 -0
- data/lib/tina4/drivers/mssql_driver.rb +112 -0
- data/lib/tina4/drivers/mysql_driver.rb +90 -0
- data/lib/tina4/drivers/postgres_driver.rb +99 -0
- data/lib/tina4/drivers/sqlite_driver.rb +85 -0
- data/lib/tina4/env.rb +55 -0
- data/lib/tina4/field_types.rb +84 -0
- data/lib/tina4/graphql.rb +837 -0
- data/lib/tina4/localization.rb +100 -0
- data/lib/tina4/middleware.rb +59 -0
- data/lib/tina4/migration.rb +124 -0
- data/lib/tina4/orm.rb +168 -0
- data/lib/tina4/public/css/tina4.css +2286 -0
- data/lib/tina4/public/css/tina4.min.css +2 -0
- data/lib/tina4/public/js/tina4.js +134 -0
- data/lib/tina4/public/js/tina4helper.js +387 -0
- data/lib/tina4/queue.rb +117 -0
- data/lib/tina4/queue_backends/kafka_backend.rb +80 -0
- data/lib/tina4/queue_backends/lite_backend.rb +79 -0
- data/lib/tina4/queue_backends/rabbitmq_backend.rb +73 -0
- data/lib/tina4/rack_app.rb +150 -0
- data/lib/tina4/request.rb +158 -0
- data/lib/tina4/response.rb +172 -0
- data/lib/tina4/router.rb +148 -0
- data/lib/tina4/scss/tina4css/_alerts.scss +34 -0
- data/lib/tina4/scss/tina4css/_badges.scss +22 -0
- data/lib/tina4/scss/tina4css/_buttons.scss +69 -0
- data/lib/tina4/scss/tina4css/_cards.scss +49 -0
- data/lib/tina4/scss/tina4css/_forms.scss +156 -0
- data/lib/tina4/scss/tina4css/_grid.scss +81 -0
- data/lib/tina4/scss/tina4css/_modals.scss +84 -0
- data/lib/tina4/scss/tina4css/_nav.scss +149 -0
- data/lib/tina4/scss/tina4css/_reset.scss +94 -0
- data/lib/tina4/scss/tina4css/_tables.scss +54 -0
- data/lib/tina4/scss/tina4css/_typography.scss +55 -0
- data/lib/tina4/scss/tina4css/_utilities.scss +197 -0
- data/lib/tina4/scss/tina4css/_variables.scss +117 -0
- data/lib/tina4/scss/tina4css/base.scss +1 -0
- data/lib/tina4/scss/tina4css/colors.scss +48 -0
- data/lib/tina4/scss/tina4css/tina4.scss +17 -0
- data/lib/tina4/scss_compiler.rb +131 -0
- data/lib/tina4/seeder.rb +529 -0
- data/lib/tina4/session.rb +145 -0
- data/lib/tina4/session_handlers/file_handler.rb +55 -0
- data/lib/tina4/session_handlers/mongo_handler.rb +49 -0
- data/lib/tina4/session_handlers/redis_handler.rb +43 -0
- data/lib/tina4/swagger.rb +123 -0
- data/lib/tina4/template.rb +478 -0
- data/lib/tina4/templates/base.twig +26 -0
- data/lib/tina4/templates/errors/403.twig +22 -0
- data/lib/tina4/templates/errors/404.twig +22 -0
- data/lib/tina4/templates/errors/500.twig +22 -0
- data/lib/tina4/testing.rb +213 -0
- data/lib/tina4/version.rb +5 -0
- data/lib/tina4/webserver.rb +101 -0
- data/lib/tina4/websocket.rb +167 -0
- data/lib/tina4/wsdl.rb +164 -0
- data/lib/tina4.rb +259 -0
- data/lib/tina4ruby.rb +4 -0
- metadata +324 -0
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
// Tina4 CSS Framework - Design Tokens
|
|
2
|
+
// ------------------------------------
|
|
3
|
+
|
|
4
|
+
// Colors
|
|
5
|
+
$primary: #4a90d9 !default;
|
|
6
|
+
$secondary: #6c757d !default;
|
|
7
|
+
$success: #28a745 !default;
|
|
8
|
+
$danger: #dc3545 !default;
|
|
9
|
+
$warning: #ffc107 !default;
|
|
10
|
+
$info: #17a2b8 !default;
|
|
11
|
+
$light: #f8f9fa !default;
|
|
12
|
+
$dark: #212529 !default;
|
|
13
|
+
$white: #fff !default;
|
|
14
|
+
$black: #000 !default;
|
|
15
|
+
$body-bg: $white !default;
|
|
16
|
+
$body-color: $dark !default;
|
|
17
|
+
$muted: #6c757d !default;
|
|
18
|
+
|
|
19
|
+
$theme-colors: (
|
|
20
|
+
"primary": $primary,
|
|
21
|
+
"secondary": $secondary,
|
|
22
|
+
"success": $success,
|
|
23
|
+
"danger": $danger,
|
|
24
|
+
"warning": $warning,
|
|
25
|
+
"info": $info,
|
|
26
|
+
"light": $light,
|
|
27
|
+
"dark": $dark
|
|
28
|
+
) !default;
|
|
29
|
+
|
|
30
|
+
// Spacing
|
|
31
|
+
$spacer: 1rem !default;
|
|
32
|
+
$spacers: (
|
|
33
|
+
0: 0,
|
|
34
|
+
1: $spacer * 0.25,
|
|
35
|
+
2: $spacer * 0.5,
|
|
36
|
+
3: $spacer,
|
|
37
|
+
4: $spacer * 1.5,
|
|
38
|
+
5: $spacer * 3
|
|
39
|
+
) !default;
|
|
40
|
+
|
|
41
|
+
// Border radius
|
|
42
|
+
$border-radius: 0.25rem !default;
|
|
43
|
+
$border-radius-sm: 0.25rem !default;
|
|
44
|
+
$border-radius-lg: 0.5rem !default;
|
|
45
|
+
$border-radius-xl: 1rem !default;
|
|
46
|
+
$border-radius-pill: 50rem !default;
|
|
47
|
+
|
|
48
|
+
// Typography
|
|
49
|
+
$font-family-base: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !default;
|
|
50
|
+
$font-family-mono: SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace !default;
|
|
51
|
+
|
|
52
|
+
$font-size-sm: 0.875rem !default;
|
|
53
|
+
$font-size-base: 1rem !default;
|
|
54
|
+
$font-size-lg: 1.125rem !default;
|
|
55
|
+
$font-size-xl: 1.25rem !default;
|
|
56
|
+
$font-size-2xl: 1.5rem !default;
|
|
57
|
+
$font-size-3xl: 1.875rem !default;
|
|
58
|
+
$font-size-4xl: 2.25rem !default;
|
|
59
|
+
|
|
60
|
+
$font-sizes: (
|
|
61
|
+
1: $font-size-4xl,
|
|
62
|
+
2: $font-size-3xl,
|
|
63
|
+
3: $font-size-2xl,
|
|
64
|
+
4: $font-size-xl,
|
|
65
|
+
5: $font-size-base,
|
|
66
|
+
6: $font-size-sm
|
|
67
|
+
) !default;
|
|
68
|
+
|
|
69
|
+
$line-height-base: 1.5 !default;
|
|
70
|
+
$line-height-sm: 1.25 !default;
|
|
71
|
+
$line-height-lg: 2 !default;
|
|
72
|
+
|
|
73
|
+
$font-weight-light: 300 !default;
|
|
74
|
+
$font-weight-normal: 400 !default;
|
|
75
|
+
$font-weight-bold: 700 !default;
|
|
76
|
+
|
|
77
|
+
// Breakpoints
|
|
78
|
+
$breakpoints: (
|
|
79
|
+
sm: 576px,
|
|
80
|
+
md: 768px,
|
|
81
|
+
lg: 992px,
|
|
82
|
+
xl: 1200px,
|
|
83
|
+
xxl: 1400px
|
|
84
|
+
) !default;
|
|
85
|
+
|
|
86
|
+
// Container max-widths
|
|
87
|
+
$container-max-widths: (
|
|
88
|
+
sm: 540px,
|
|
89
|
+
md: 720px,
|
|
90
|
+
lg: 960px,
|
|
91
|
+
xl: 1140px,
|
|
92
|
+
xxl: 1320px
|
|
93
|
+
) !default;
|
|
94
|
+
|
|
95
|
+
// Grid
|
|
96
|
+
$grid-columns: 12 !default;
|
|
97
|
+
$grid-gutter: 1.5rem !default;
|
|
98
|
+
|
|
99
|
+
// Shadows
|
|
100
|
+
$shadow-sm: 0 0.125rem 0.25rem rgba($black, 0.075) !default;
|
|
101
|
+
$shadow: 0 0.5rem 1rem rgba($black, 0.15) !default;
|
|
102
|
+
$shadow-lg: 0 1rem 3rem rgba($black, 0.175) !default;
|
|
103
|
+
|
|
104
|
+
// Transitions
|
|
105
|
+
$transition-base: all 0.2s ease-in-out !default;
|
|
106
|
+
$transition-fade: opacity 0.15s linear !default;
|
|
107
|
+
|
|
108
|
+
// Z-index
|
|
109
|
+
$zindex-dropdown: 1000 !default;
|
|
110
|
+
$zindex-sticky: 1020 !default;
|
|
111
|
+
$zindex-fixed: 1030 !default;
|
|
112
|
+
$zindex-backdrop: 1040 !default;
|
|
113
|
+
$zindex-modal: 1050 !default;
|
|
114
|
+
|
|
115
|
+
// Links
|
|
116
|
+
$link-color: $primary !default;
|
|
117
|
+
$link-hover-color: darken($primary, 15%) !default;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
@import 'tina4';
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// Tina4 CSS Framework - CSS Custom Properties
|
|
2
|
+
// Exposes the design tokens as CSS custom properties for runtime use
|
|
3
|
+
|
|
4
|
+
@import 'variables';
|
|
5
|
+
|
|
6
|
+
:root {
|
|
7
|
+
// Theme colors
|
|
8
|
+
--t4-primary: #{$primary};
|
|
9
|
+
--t4-secondary: #{$secondary};
|
|
10
|
+
--t4-success: #{$success};
|
|
11
|
+
--t4-danger: #{$danger};
|
|
12
|
+
--t4-warning: #{$warning};
|
|
13
|
+
--t4-info: #{$info};
|
|
14
|
+
--t4-light: #{$light};
|
|
15
|
+
--t4-dark: #{$dark};
|
|
16
|
+
--t4-white: #{$white};
|
|
17
|
+
--t4-black: #{$black};
|
|
18
|
+
--t4-muted: #{$muted};
|
|
19
|
+
|
|
20
|
+
// Body
|
|
21
|
+
--t4-body-bg: #{$body-bg};
|
|
22
|
+
--t4-body-color: #{$body-color};
|
|
23
|
+
|
|
24
|
+
// Typography
|
|
25
|
+
--t4-font-family: #{$font-family-base};
|
|
26
|
+
--t4-font-family-mono: #{$font-family-mono};
|
|
27
|
+
--t4-font-size-base: #{$font-size-base};
|
|
28
|
+
--t4-line-height-base: #{$line-height-base};
|
|
29
|
+
|
|
30
|
+
// Spacing
|
|
31
|
+
--t4-spacer: #{$spacer};
|
|
32
|
+
|
|
33
|
+
// Border radius
|
|
34
|
+
--t4-border-radius: #{$border-radius};
|
|
35
|
+
--t4-border-radius-lg: #{$border-radius-lg};
|
|
36
|
+
--t4-border-radius-xl: #{$border-radius-xl};
|
|
37
|
+
|
|
38
|
+
// Shadows
|
|
39
|
+
--t4-shadow-sm: #{$shadow-sm};
|
|
40
|
+
--t4-shadow: #{$shadow};
|
|
41
|
+
--t4-shadow-lg: #{$shadow-lg};
|
|
42
|
+
|
|
43
|
+
// Transitions
|
|
44
|
+
--t4-transition: #{$transition-base};
|
|
45
|
+
|
|
46
|
+
// Link
|
|
47
|
+
--t4-link-color: #{$link-color};
|
|
48
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Tina4 CSS Framework
|
|
2
|
+
// A lightweight, modern, responsive CSS framework
|
|
3
|
+
// ================================================
|
|
4
|
+
|
|
5
|
+
@import 'variables';
|
|
6
|
+
@import 'reset';
|
|
7
|
+
@import 'typography';
|
|
8
|
+
@import 'grid';
|
|
9
|
+
@import 'buttons';
|
|
10
|
+
@import 'forms';
|
|
11
|
+
@import 'cards';
|
|
12
|
+
@import 'nav';
|
|
13
|
+
@import 'modals';
|
|
14
|
+
@import 'alerts';
|
|
15
|
+
@import 'tables';
|
|
16
|
+
@import 'badges';
|
|
17
|
+
@import 'utilities';
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
require "fileutils"
|
|
3
|
+
|
|
4
|
+
module Tina4
|
|
5
|
+
module ScssCompiler
|
|
6
|
+
SCSS_DIRS = %w[src/scss scss src/styles styles].freeze
|
|
7
|
+
CSS_OUTPUT = "public/css"
|
|
8
|
+
|
|
9
|
+
class << self
|
|
10
|
+
def compile_all(root_dir = Dir.pwd)
|
|
11
|
+
output_dir = File.join(root_dir, CSS_OUTPUT)
|
|
12
|
+
FileUtils.mkdir_p(output_dir)
|
|
13
|
+
|
|
14
|
+
SCSS_DIRS.each do |dir|
|
|
15
|
+
scss_dir = File.join(root_dir, dir)
|
|
16
|
+
next unless Dir.exist?(scss_dir)
|
|
17
|
+
|
|
18
|
+
Dir.glob(File.join(scss_dir, "**/*.scss")).each do |scss_file|
|
|
19
|
+
next if File.basename(scss_file).start_with?("_") # Skip partials
|
|
20
|
+
compile_file(scss_file, output_dir, scss_dir)
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
|
|
25
|
+
def compile_file(scss_file, output_dir, base_dir)
|
|
26
|
+
relative = scss_file.sub(base_dir, "").sub(/\.scss$/, ".css")
|
|
27
|
+
css_file = File.join(output_dir, relative)
|
|
28
|
+
FileUtils.mkdir_p(File.dirname(css_file))
|
|
29
|
+
|
|
30
|
+
scss_content = File.read(scss_file)
|
|
31
|
+
css_content = compile_scss(scss_content, File.dirname(scss_file))
|
|
32
|
+
File.write(css_file, css_content)
|
|
33
|
+
|
|
34
|
+
Tina4::Debug.debug("Compiled SCSS: #{scss_file} -> #{css_file}")
|
|
35
|
+
rescue => e
|
|
36
|
+
Tina4::Debug.error("SCSS compilation failed: #{scss_file} - #{e.message}")
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
def compile_scss(content, base_dir)
|
|
40
|
+
# Try sassc gem first
|
|
41
|
+
begin
|
|
42
|
+
require "sassc"
|
|
43
|
+
return SassC::Engine.new(content, style: :expanded, load_paths: [base_dir]).render
|
|
44
|
+
rescue LoadError
|
|
45
|
+
# Fall through to basic compiler
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
# Basic SCSS to CSS conversion (handles common patterns)
|
|
49
|
+
basic_compile(content, base_dir)
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
private
|
|
53
|
+
|
|
54
|
+
def basic_compile(content, base_dir)
|
|
55
|
+
# Handle @import
|
|
56
|
+
content = process_imports(content, base_dir)
|
|
57
|
+
|
|
58
|
+
# Handle variables
|
|
59
|
+
variables = {}
|
|
60
|
+
content = content.gsub(/\$([a-zA-Z_][\w-]*)\s*:\s*(.+?);/) do
|
|
61
|
+
variables[Regexp.last_match(1)] = Regexp.last_match(2).strip
|
|
62
|
+
""
|
|
63
|
+
end
|
|
64
|
+
|
|
65
|
+
# Replace variable references
|
|
66
|
+
variables.each do |name, value|
|
|
67
|
+
content = content.gsub("$#{name}", value)
|
|
68
|
+
end
|
|
69
|
+
|
|
70
|
+
# Handle nesting (basic single-level)
|
|
71
|
+
content = flatten_nesting(content)
|
|
72
|
+
|
|
73
|
+
# Handle & parent selector
|
|
74
|
+
content = content.gsub(/&/, "")
|
|
75
|
+
|
|
76
|
+
content
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
def process_imports(content, base_dir)
|
|
80
|
+
content.gsub(/@import\s+["'](.+?)["']\s*;/) do
|
|
81
|
+
import_path = Regexp.last_match(1)
|
|
82
|
+
candidates = [
|
|
83
|
+
File.join(base_dir, "#{import_path}.scss"),
|
|
84
|
+
File.join(base_dir, "_#{import_path}.scss"),
|
|
85
|
+
File.join(base_dir, import_path)
|
|
86
|
+
]
|
|
87
|
+
found = candidates.find { |c| File.exist?(c) }
|
|
88
|
+
if found
|
|
89
|
+
imported = File.read(found)
|
|
90
|
+
process_imports(imported, File.dirname(found))
|
|
91
|
+
else
|
|
92
|
+
"/* import not found: #{import_path} */"
|
|
93
|
+
end
|
|
94
|
+
end
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
def flatten_nesting(content)
|
|
98
|
+
# Very basic nesting flattener - handles single level
|
|
99
|
+
result = ""
|
|
100
|
+
content.scan(/([^{]+)\{([^{}]*(?:\{[^{}]*\}[^{}]*)*)\}/m) do |selector, body|
|
|
101
|
+
selector = selector.strip
|
|
102
|
+
# Check for nested rules
|
|
103
|
+
if body =~ /\{/
|
|
104
|
+
# Has nested content
|
|
105
|
+
props = ""
|
|
106
|
+
nested = ""
|
|
107
|
+
body.scan(/([^{;]+(?:\{[^}]*\}|;))/m) do |part_arr|
|
|
108
|
+
part = part_arr[0].strip
|
|
109
|
+
if part.include?("{")
|
|
110
|
+
# Nested rule
|
|
111
|
+
if part =~ /\A(.+?)\s*\{(.*?)\}\s*\z/m
|
|
112
|
+
nested_sel = Regexp.last_match(1).strip
|
|
113
|
+
nested_body = Regexp.last_match(2).strip
|
|
114
|
+
full_sel = "#{selector} #{nested_sel}"
|
|
115
|
+
nested += "#{full_sel} { #{nested_body} }\n"
|
|
116
|
+
end
|
|
117
|
+
else
|
|
118
|
+
props += " #{part}\n" unless part.empty?
|
|
119
|
+
end
|
|
120
|
+
end
|
|
121
|
+
result += "#{selector} {\n#{props}}\n" unless props.strip.empty?
|
|
122
|
+
result += nested
|
|
123
|
+
else
|
|
124
|
+
result += "#{selector} {\n#{body}\n}\n"
|
|
125
|
+
end
|
|
126
|
+
end
|
|
127
|
+
result.empty? ? content : result
|
|
128
|
+
end
|
|
129
|
+
end
|
|
130
|
+
end
|
|
131
|
+
end
|