super 0.0.8 → 0.0.9

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/.yardopts +2 -0
  3. data/README.md +47 -61
  4. data/STABILITY.md +2 -2
  5. data/app/assets/javascripts/super/application.js +109 -105
  6. data/app/assets/stylesheets/super/application.css +5600 -0
  7. data/app/views/layouts/super/application.html.erb +10 -2
  8. data/app/views/super/application/_display_rich_text.html.erb +1 -0
  9. data/app/views/super/application/_form_field_checkbox.html.erb +15 -0
  10. data/app/views/super/application/_form_field_generic.html.erb +19 -0
  11. data/app/views/super/application/_form_field_rich_text_area.html.erb +13 -0
  12. data/app/views/super/application/_super_schema_display_show.html.erb +3 -3
  13. data/docs/README.md +4 -2
  14. data/docs/action_text.md +48 -0
  15. data/docs/cheat.md +8 -8
  16. data/docs/faq.md +3 -3
  17. data/docs/installation.md +21 -0
  18. data/docs/quick_start.md +1 -16
  19. data/docs/webpacker.md +13 -5
  20. data/frontend/super-frontend/build.js +1 -1
  21. data/frontend/super-frontend/dist/application.css +5600 -0
  22. data/frontend/super-frontend/dist/application.js +109 -105
  23. data/frontend/super-frontend/package.json +1 -2
  24. data/frontend/super-frontend/src/javascripts/super/{application.ts → application.js} +0 -0
  25. data/frontend/super-frontend/src/javascripts/super/{apply_template_controller.ts → apply_template_controller.js} +3 -5
  26. data/frontend/super-frontend/src/javascripts/super/{toggle_pending_destruction_controller.ts → toggle_pending_destruction_controller.js} +2 -2
  27. data/frontend/super-frontend/tailwind.config.js +2 -2
  28. data/frontend/super-frontend/yarn.lock +0 -5
  29. data/lib/generators/super/action_text/USAGE +23 -0
  30. data/lib/generators/super/action_text/action_text_generator.rb +30 -0
  31. data/lib/generators/super/action_text/templates/pack_super_action_text.css +23 -0
  32. data/lib/generators/super/action_text/templates/pack_super_action_text.js +4 -0
  33. data/lib/generators/super/webpacker/USAGE +5 -4
  34. data/lib/super/assets.rb +4 -0
  35. data/lib/super/display/schema_types.rb +6 -0
  36. data/lib/super/form/schema_types.rb +10 -0
  37. data/lib/super/version.rb +1 -1
  38. metadata +15 -7
  39. data/frontend/super-frontend/src/javascripts/super/rails__ujs.d.ts +0 -1
  40. data/frontend/super-frontend/tsconfig.json +0 -13
@@ -4271,154 +4271,158 @@ Object.keys(_core).forEach(function (key) {
4271
4271
  }
4272
4272
  });
4273
4273
  });
4274
- },{"@stimulus/core":"../node_modules/@stimulus/core/dist/index.js"}],"javascripts/super/apply_template_controller.ts":[function(require,module,exports) {
4274
+ },{"@stimulus/core":"../node_modules/@stimulus/core/dist/index.js"}],"javascripts/super/apply_template_controller.js":[function(require,module,exports) {
4275
4275
  "use strict";
4276
4276
 
4277
- var __extends = this && this.__extends || function () {
4278
- var _extendStatics = function extendStatics(d, b) {
4279
- _extendStatics = Object.setPrototypeOf || {
4280
- __proto__: []
4281
- } instanceof Array && function (d, b) {
4282
- d.__proto__ = b;
4283
- } || function (d, b) {
4284
- for (var p in b) {
4285
- if (b.hasOwnProperty(p)) d[p] = b[p];
4286
- }
4287
- };
4277
+ Object.defineProperty(exports, "__esModule", {
4278
+ value: true
4279
+ });
4280
+ exports.default = void 0;
4288
4281
 
4289
- return _extendStatics(d, b);
4290
- };
4282
+ var _stimulus = require("stimulus");
4291
4283
 
4292
- return function (d, b) {
4293
- _extendStatics(d, b);
4284
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4294
4285
 
4295
- function __() {
4296
- this.constructor = d;
4297
- }
4286
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4298
4287
 
4299
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
4300
- };
4301
- }();
4288
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
4302
4289
 
4303
- Object.defineProperty(exports, "__esModule", {
4304
- value: true
4305
- });
4290
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
4306
4291
 
4307
- var stimulus_1 = require("stimulus");
4292
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
4308
4293
 
4309
- var default_1 =
4310
- /** @class */
4311
- function (_super) {
4312
- __extends(default_1, _super);
4294
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
4313
4295
 
4314
- function default_1() {
4315
- return _super !== null && _super.apply(this, arguments) || this;
4316
- }
4296
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
4317
4297
 
4318
- default_1.prototype.call = function (event) {
4319
- event.preventDefault();
4320
- var unixtime = new Date().getTime();
4321
- var content = this.templateTarget.innerHTML.replace(/TEMPLATEINDEX/g, unixtime.toString());
4322
- this.templateTarget.insertAdjacentHTML("beforebegin", content);
4323
- };
4298
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
4324
4299
 
4325
- default_1.targets = ["template"];
4326
- return default_1;
4327
- }(stimulus_1.Controller);
4300
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
4328
4301
 
4329
- exports.default = default_1;
4330
- },{"stimulus":"../node_modules/stimulus/index.js"}],"javascripts/super/toggle_pending_destruction_controller.ts":[function(require,module,exports) {
4331
- "use strict";
4302
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
4332
4303
 
4333
- var __extends = this && this.__extends || function () {
4334
- var _extendStatics = function extendStatics(d, b) {
4335
- _extendStatics = Object.setPrototypeOf || {
4336
- __proto__: []
4337
- } instanceof Array && function (d, b) {
4338
- d.__proto__ = b;
4339
- } || function (d, b) {
4340
- for (var p in b) {
4341
- if (b.hasOwnProperty(p)) d[p] = b[p];
4342
- }
4343
- };
4304
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
4344
4305
 
4345
- return _extendStatics(d, b);
4346
- };
4306
+ function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
4347
4307
 
4348
- return function (d, b) {
4349
- _extendStatics(d, b);
4308
+ var _default = /*#__PURE__*/function (_Controller) {
4309
+ _inherits(_default, _Controller);
4350
4310
 
4351
- function __() {
4352
- this.constructor = d;
4311
+ var _super = _createSuper(_default);
4312
+
4313
+ function _default() {
4314
+ _classCallCheck(this, _default);
4315
+
4316
+ return _super.apply(this, arguments);
4317
+ }
4318
+
4319
+ _createClass(_default, [{
4320
+ key: "call",
4321
+ value: function call(event) {
4322
+ event.preventDefault();
4323
+ var unixtime = new Date().getTime();
4324
+ var content = this.templateTarget.innerHTML.replace(/TEMPLATEINDEX/g, unixtime.toString());
4325
+ this.templateTarget.insertAdjacentHTML("beforebegin", content);
4353
4326
  }
4327
+ }]);
4354
4328
 
4355
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
4356
- };
4357
- }();
4329
+ return _default;
4330
+ }(_stimulus.Controller);
4331
+
4332
+ exports.default = _default;
4333
+
4334
+ _defineProperty(_default, "targets", ["template"]);
4335
+ },{"stimulus":"../node_modules/stimulus/index.js"}],"javascripts/super/toggle_pending_destruction_controller.js":[function(require,module,exports) {
4336
+ "use strict";
4358
4337
 
4359
4338
  Object.defineProperty(exports, "__esModule", {
4360
4339
  value: true
4361
4340
  });
4341
+ exports.default = void 0;
4362
4342
 
4363
- var stimulus_1 = require("stimulus");
4343
+ var _stimulus = require("stimulus");
4364
4344
 
4365
- var default_1 =
4366
- /** @class */
4367
- function (_super) {
4368
- __extends(default_1, _super);
4345
+ function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
4346
+
4347
+ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
4348
+
4349
+ function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
4350
+
4351
+ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
4352
+
4353
+ function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
4354
+
4355
+ function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
4356
+
4357
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
4358
+
4359
+ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
4360
+
4361
+ function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
4362
+
4363
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
4364
+
4365
+ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
4366
+
4367
+ var _default = /*#__PURE__*/function (_Controller) {
4368
+ _inherits(_default, _Controller);
4369
4369
 
4370
- function default_1() {
4371
- return _super !== null && _super.apply(this, arguments) || this;
4370
+ var _super = _createSuper(_default);
4371
+
4372
+ function _default() {
4373
+ _classCallCheck(this, _default);
4374
+
4375
+ return _super.apply(this, arguments);
4372
4376
  }
4373
4377
 
4374
- default_1.prototype.call = function (event) {
4375
- var target = event.target;
4378
+ _createClass(_default, [{
4379
+ key: "call",
4380
+ value: function call(event) {
4381
+ var target = event.target;
4376
4382
 
4377
- if (target) {
4378
- if (target.checked) {
4379
- this.element.classList.add("opacity-75", "bg-gray-100");
4380
- } else {
4381
- this.element.classList.remove("opacity-75", "bg-gray-100");
4383
+ if (target) {
4384
+ if (target.checked) {
4385
+ this.element.classList.add("opacity-75", "bg-gray-100");
4386
+ } else {
4387
+ this.element.classList.remove("opacity-75", "bg-gray-100");
4388
+ }
4382
4389
  }
4383
4390
  }
4384
- };
4391
+ }]);
4385
4392
 
4386
- return default_1;
4387
- }(stimulus_1.Controller);
4393
+ return _default;
4394
+ }(_stimulus.Controller);
4388
4395
 
4389
- exports.default = default_1;
4390
- },{"stimulus":"../node_modules/stimulus/index.js"}],"javascripts/super/application.ts":[function(require,module,exports) {
4396
+ exports.default = _default;
4397
+ },{"stimulus":"../node_modules/stimulus/index.js"}],"javascripts/super/application.js":[function(require,module,exports) {
4391
4398
  "use strict";
4392
4399
 
4393
- var __importDefault = this && this.__importDefault || function (mod) {
4394
- return mod && mod.__esModule ? mod : {
4395
- "default": mod
4396
- };
4397
- };
4398
-
4399
4400
  Object.defineProperty(exports, "__esModule", {
4400
4401
  value: true
4401
4402
  });
4402
- exports.StimulusController = exports.StimulusApplication = void 0;
4403
-
4404
- var ujs_1 = __importDefault(require("@rails/ujs"));
4405
-
4406
- var stimulus_1 = require("stimulus");
4407
-
4408
4403
  Object.defineProperty(exports, "StimulusController", {
4409
4404
  enumerable: true,
4410
- get: function get() {
4411
- return stimulus_1.Controller;
4405
+ get: function () {
4406
+ return _stimulus.Controller;
4412
4407
  }
4413
4408
  });
4409
+ exports.StimulusApplication = void 0;
4410
+
4411
+ var _ujs = _interopRequireDefault(require("@rails/ujs"));
4412
+
4413
+ var _stimulus = require("stimulus");
4414
+
4415
+ var _apply_template_controller = _interopRequireDefault(require("./apply_template_controller"));
4416
+
4417
+ var _toggle_pending_destruction_controller = _interopRequireDefault(require("./toggle_pending_destruction_controller"));
4418
+
4419
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
4414
4420
 
4415
- var apply_template_controller_1 = __importDefault(require("./apply_template_controller"));
4421
+ _ujs.default.start();
4416
4422
 
4417
- var toggle_pending_destruction_controller_1 = __importDefault(require("./toggle_pending_destruction_controller"));
4423
+ var StimulusApplication = _stimulus.Application.start();
4418
4424
 
4419
- ujs_1.default.start();
4420
- var StimulusApplication = stimulus_1.Application.start();
4421
4425
  exports.StimulusApplication = StimulusApplication;
4422
- StimulusApplication.register("apply-template", apply_template_controller_1.default);
4423
- StimulusApplication.register("toggle-pending-destruction", toggle_pending_destruction_controller_1.default);
4424
- },{"@rails/ujs":"../node_modules/@rails/ujs/lib/assets/compiled/rails-ujs.js","stimulus":"../node_modules/stimulus/index.js","./apply_template_controller":"javascripts/super/apply_template_controller.ts","./toggle_pending_destruction_controller":"javascripts/super/toggle_pending_destruction_controller.ts"}]},{},["javascripts/super/application.ts"], "Super")
4426
+ StimulusApplication.register("apply-template", _apply_template_controller.default);
4427
+ StimulusApplication.register("toggle-pending-destruction", _toggle_pending_destruction_controller.default);
4428
+ },{"@rails/ujs":"../node_modules/@rails/ujs/lib/assets/compiled/rails-ujs.js","stimulus":"../node_modules/stimulus/index.js","./apply_template_controller":"javascripts/super/apply_template_controller.js","./toggle_pending_destruction_controller":"javascripts/super/toggle_pending_destruction_controller.js"}]},{},["javascripts/super/application.js"], "Super")
@@ -6,8 +6,7 @@
6
6
  },
7
7
  "devDependencies": {
8
8
  "parcel-bundler": "^1.12.3",
9
- "prettier": "1.19.1",
10
- "typescript": "^3.7.4"
9
+ "prettier": "1.19.1"
11
10
  },
12
11
  "scripts": {
13
12
  "build": "node build.js",
@@ -1,19 +1,17 @@
1
1
  import { Controller } from "stimulus";
2
2
 
3
3
  export default class extends Controller {
4
- templateTarget: Element | undefined;
5
-
6
4
  static targets = ["template"];
7
5
 
8
- call(event: Event) {
6
+ call(event) {
9
7
  event.preventDefault();
10
8
 
11
9
  const unixtime = new Date().getTime();
12
- let content = this.templateTarget!.innerHTML.replace(
10
+ let content = this.templateTarget.innerHTML.replace(
13
11
  /TEMPLATEINDEX/g,
14
12
  unixtime.toString()
15
13
  );
16
14
 
17
- this.templateTarget!.insertAdjacentHTML("beforebegin", content);
15
+ this.templateTarget.insertAdjacentHTML("beforebegin", content);
18
16
  }
19
17
  }
@@ -1,11 +1,11 @@
1
1
  import { Controller } from "stimulus";
2
2
 
3
3
  export default class extends Controller {
4
- call(event: Event) {
4
+ call(event) {
5
5
  let target = event.target;
6
6
 
7
7
  if (target) {
8
- if ((<HTMLInputElement>target).checked) {
8
+ if (target.checked) {
9
9
  this.element.classList.add("opacity-75", "bg-gray-100");
10
10
  } else {
11
11
  this.element.classList.remove("opacity-75", "bg-gray-100");
@@ -6,8 +6,8 @@ module.exports = {
6
6
  extend: {},
7
7
  },
8
8
  variants: {
9
- backgroundColor: ({ after }) => after(["group-hover"], "responsive"),
10
- borderColor: ({ after }) => after(["group-hover"], "responsive"),
9
+ backgroundColor: ({ after }) => after(["group-hover", "checked"], "responsive"),
10
+ borderColor: ({ after }) => after(["group-hover", "checked"], "responsive"),
11
11
  borderRadius: ({ after }) => after(["first", "last"], "responsive"),
12
12
  padding: ({ after }) => after(["first", "last"]),
13
13
  },
@@ -5170,11 +5170,6 @@ typedarray@^0.0.6:
5170
5170
  resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777"
5171
5171
  integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=
5172
5172
 
5173
- typescript@^3.7.4:
5174
- version "3.9.7"
5175
- resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.9.7.tgz#98d600a5ebdc38f40cb277522f12dc800e9e25fa"
5176
- integrity sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==
5177
-
5178
5173
  uncss@^0.17.3:
5179
5174
  version "0.17.3"
5180
5175
  resolved "https://registry.yarnpkg.com/uncss/-/uncss-0.17.3.tgz#50fc1eb4ed573ffff763458d801cd86e4d69ea11"
@@ -0,0 +1,23 @@
1
+ Description:
2
+ Creates the necessary files for Super to support ActionText
3
+
4
+ Prerequisites:
5
+
6
+ * Webpacker must be installed on your Rails app
7
+ * Run: bundle exec rails webpacker:install
8
+
9
+ * ActionText must be installed on your Rails app
10
+ * Run: bundle exec rails action_text:install
11
+
12
+ Note that Super does NOT need to be configured to use Webpacker. But if you
13
+ do use Super with Webpacker, you can merge `action_text.js` into
14
+ `application.js.erb` file.
15
+
16
+ Example:
17
+ bin/rails webpacker:install # if you haven't already
18
+ bin/rails action_text:install # if you haven't already
19
+ bin/rails generate super:action_text
20
+
21
+ This will:
22
+ Create app/javascript/packs/super/action_text.js
23
+ Modify config/initializers/super.rb
@@ -0,0 +1,30 @@
1
+ module Super
2
+ class ActionTextGenerator < Rails::Generators::Base
3
+ source_root File.expand_path("templates", __dir__)
4
+
5
+ def copy_the_pack_files
6
+ template(
7
+ "pack_super_action_text.js",
8
+ "app/javascript/packs/super/action_text.js"
9
+ )
10
+ template(
11
+ "pack_super_action_text.css",
12
+ "app/javascript/packs/super/action_text.css"
13
+ )
14
+ end
15
+
16
+ def add_action_text_assets_to_config
17
+ insert_into_file(
18
+ "config/initializers/super.rb",
19
+ " c.javascripts.push(Super::Assets.webpacker(\"super/action_text\"))\n" \
20
+ " c.stylesheets.push(Super::Assets.webpacker(\"super/action_text\"))\n",
21
+ before: /\bend\b/
22
+ )
23
+ end
24
+
25
+ def remind_about_webpacker
26
+ say "Make sure Webpacker is set up on your application!", :bold
27
+ say "Run if needed: bundle exec rails webpacker:install"
28
+ end
29
+ end
30
+ end
@@ -0,0 +1,23 @@
1
+ @import "trix/dist/trix";
2
+
3
+ /* This is the SCSS that the ActionText installation generator adds, compiled to CSS */
4
+ .trix-content .attachment-gallery > action-text-attachment,
5
+ .trix-content .attachment-gallery > .attachment {
6
+ flex: 1 0 33%;
7
+ padding: 0 0.5em;
8
+ max-width: 33%; }
9
+ .trix-content .attachment-gallery.attachment-gallery--2 > action-text-attachment,
10
+ .trix-content .attachment-gallery.attachment-gallery--2 > .attachment,
11
+ .trix-content .attachment-gallery.attachment-gallery--4 > action-text-attachment,
12
+ .trix-content .attachment-gallery.attachment-gallery--4 > .attachment {
13
+ flex-basis: 50%;
14
+ max-width: 50%; }
15
+ .trix-content action-text-attachment .attachment {
16
+ padding: 0 !important;
17
+ max-width: 100% !important; }
18
+
19
+ /* This is for getting Tailwind to work with Trix */
20
+ .trix-content ul {
21
+ list-style-type: disc; }
22
+ .trix-content ol {
23
+ list-style-type: decimal; }
@@ -0,0 +1,4 @@
1
+ import * as ActiveStorage from "@rails/activestorage"
2
+ ActiveStorage.start()
3
+ require("trix")
4
+ require("@rails/actiontext")
@@ -1,14 +1,15 @@
1
1
  Description:
2
2
  Creates the necessary files for assets to be served under Webpacker
3
3
 
4
- Webpacker support requires ERB support. There are no other dependencies.
4
+ Webpacker support requires that you install ERB support for Webpacker.
5
5
 
6
6
  Installing ERB on webpacker is usually done by running the command:
7
7
  `rails webpacker:install:erb`
8
8
 
9
9
  Example:
10
10
  rails webpacker:install:erb # if you hadn't set up ERB already
11
- rails generate super:install:webpacker
11
+ rails generate super:webpacker
12
12
 
13
- This will create:
14
- app/javascript/packs/super/application.js.erb
13
+ This will:
14
+ Create app/javascript/packs/super/application.js.erb
15
+ Modify config/initializers/super.rb
@@ -80,6 +80,10 @@ module Super
80
80
  sprockets
81
81
  elsif Gem::Dependency.new("sprockets", "~> 2.0").matching_specs.any?
82
82
  sprockets
83
+ elsif Gem::Dependency.new("webpacker", "~> 6.0").matching_specs.any?
84
+ webpacker
85
+ elsif Gem::Dependency.new("webpacker", "~> 5.0").matching_specs.any?
86
+ webpacker
83
87
  elsif Gem::Dependency.new("webpacker", "~> 4.0").matching_specs.any?
84
88
  webpacker
85
89
  elsif Gem::Dependency.new("webpacker", "~> 3.0").matching_specs.any?