JSFiddle - React, Tailwind, and code Playground

by Jagi

JavaScript

(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
var baselineCache_ = {};

function styleKey_(style) {
	return (typeof(style) === 'string') ? style : ('font: ' + style.font + '; textBaseline: ' + style.textBaseline);
}

function fetch(style) {
	var styleKey = styleKey_(style);
	if (baselineCache_.hasOwnProperty(styleKey))
		return baselineCache_[styleKey];
	else
		return {};
}

function store(style, metrics) {
	var styleKey = styleKey_(style);

	var allBaselineProperties = ['alphabeticBaseline', 'hangingBaseline', 'ideographicBaseline', 'emHeightAscent', 'emHeightDescent'];
	var cacheObj = fetch(styleKey);

	for (var i = 0; i < allBaselineProperties; ++i) {
		var prop = allBaselineProperties[i];
		if (cacheObj.hasOwnProperty(prop))
			continue;
		if (metrics.hasOwnProperty(prop) && (metrics[prop] !== undefined))
			cacheObj[prop] = metrics[prop] - cacheObj[prop];
	}

	baselineCache_[styleKey] = cacheObj;
}

function clear() {
	baselineCache_ = {};
}

module.exports = {
	fetch : fetch,
	store : store,
	clear : clear
};
},{}],2:[function(require,module,exports){
module.exports = function CanvasMeasurementContext() {
	'use strict';

	var value_whiteOpaque8 = 255 | 0;
	var value_whiteOpaque32 = 0xffffffff;

	var document_ = null;
	var text_ = "";
	var rootElement_ = null;
	var ctx_ = null;
	var font_ = "";
	var padding_ = {
		top : 0,
		bottom : 0,
		left : 0,
		right : 0
	};
	var fontSize_;
	var nativeMetrics_ = null;
	var isSpace_ = null;

	this.document = function (doc) {
		if (arguments.length > 0) {
			if (document_ != doc)...