super 0.0.8 → 0.0.9
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 +4 -4
- data/.yardopts +2 -0
- data/README.md +47 -61
- data/STABILITY.md +2 -2
- data/app/assets/javascripts/super/application.js +109 -105
- data/app/assets/stylesheets/super/application.css +5600 -0
- data/app/views/layouts/super/application.html.erb +10 -2
- data/app/views/super/application/_display_rich_text.html.erb +1 -0
- data/app/views/super/application/_form_field_checkbox.html.erb +15 -0
- data/app/views/super/application/_form_field_generic.html.erb +19 -0
- data/app/views/super/application/_form_field_rich_text_area.html.erb +13 -0
- data/app/views/super/application/_super_schema_display_show.html.erb +3 -3
- data/docs/README.md +4 -2
- data/docs/action_text.md +48 -0
- data/docs/cheat.md +8 -8
- data/docs/faq.md +3 -3
- data/docs/installation.md +21 -0
- data/docs/quick_start.md +1 -16
- data/docs/webpacker.md +13 -5
- data/frontend/super-frontend/build.js +1 -1
- data/frontend/super-frontend/dist/application.css +5600 -0
- data/frontend/super-frontend/dist/application.js +109 -105
- data/frontend/super-frontend/package.json +1 -2
- data/frontend/super-frontend/src/javascripts/super/{application.ts → application.js} +0 -0
- data/frontend/super-frontend/src/javascripts/super/{apply_template_controller.ts → apply_template_controller.js} +3 -5
- data/frontend/super-frontend/src/javascripts/super/{toggle_pending_destruction_controller.ts → toggle_pending_destruction_controller.js} +2 -2
- data/frontend/super-frontend/tailwind.config.js +2 -2
- data/frontend/super-frontend/yarn.lock +0 -5
- data/lib/generators/super/action_text/USAGE +23 -0
- data/lib/generators/super/action_text/action_text_generator.rb +30 -0
- data/lib/generators/super/action_text/templates/pack_super_action_text.css +23 -0
- data/lib/generators/super/action_text/templates/pack_super_action_text.js +4 -0
- data/lib/generators/super/webpacker/USAGE +5 -4
- data/lib/super/assets.rb +4 -0
- data/lib/super/display/schema_types.rb +6 -0
- data/lib/super/form/schema_types.rb +10 -0
- data/lib/super/version.rb +1 -1
- metadata +15 -7
- data/frontend/super-frontend/src/javascripts/super/rails__ujs.d.ts +0 -1
- 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.
|
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
|
-
|
4278
|
-
|
4279
|
-
|
4280
|
-
|
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
|
-
|
4290
|
-
};
|
4282
|
+
var _stimulus = require("stimulus");
|
4291
4283
|
|
4292
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
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
|
-
|
4349
|
-
|
4308
|
+
var _default = /*#__PURE__*/function (_Controller) {
|
4309
|
+
_inherits(_default, _Controller);
|
4350
4310
|
|
4351
|
-
|
4352
|
-
|
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
|
-
|
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
|
4343
|
+
var _stimulus = require("stimulus");
|
4364
4344
|
|
4365
|
-
|
4366
|
-
|
4367
|
-
function (
|
4368
|
-
|
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
|
-
|
4371
|
-
|
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
|
-
|
4375
|
-
|
4378
|
+
_createClass(_default, [{
|
4379
|
+
key: "call",
|
4380
|
+
value: function call(event) {
|
4381
|
+
var target = event.target;
|
4376
4382
|
|
4377
|
-
|
4378
|
-
|
4379
|
-
|
4380
|
-
|
4381
|
-
|
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
|
4387
|
-
}(
|
4393
|
+
return _default;
|
4394
|
+
}(_stimulus.Controller);
|
4388
4395
|
|
4389
|
-
exports.default =
|
4390
|
-
},{"stimulus":"../node_modules/stimulus/index.js"}],"javascripts/super/application.
|
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
|
4411
|
-
return
|
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
|
-
|
4421
|
+
_ujs.default.start();
|
4416
4422
|
|
4417
|
-
var
|
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",
|
4423
|
-
StimulusApplication.register("toggle-pending-destruction",
|
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.
|
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")
|
File without changes
|
@@ -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
|
6
|
+
call(event) {
|
9
7
|
event.preventDefault();
|
10
8
|
|
11
9
|
const unixtime = new Date().getTime();
|
12
|
-
let content = this.templateTarget
|
10
|
+
let content = this.templateTarget.innerHTML.replace(
|
13
11
|
/TEMPLATEINDEX/g,
|
14
12
|
unixtime.toString()
|
15
13
|
);
|
16
14
|
|
17
|
-
this.templateTarget
|
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
|
4
|
+
call(event) {
|
5
5
|
let target = event.target;
|
6
6
|
|
7
7
|
if (target) {
|
8
|
-
if (
|
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; }
|
@@ -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
|
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:
|
11
|
+
rails generate super:webpacker
|
12
12
|
|
13
|
-
This will
|
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
|
data/lib/super/assets.rb
CHANGED
@@ -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?
|